Mam dwie opcje: doAsyncStuff i doNextStep. Jak mogę zapewnić wykonanie doNextStep dopiero po zakończeniu doAsyncStuff?
Próbowałem coś w tym rodzaju, ale to nie pomogło: doAsyncStuff().then(_ => doNextStep());
async function doAsyncStuff() {
if (vscode.workspace.workspaceFolders) {
vscode.workspace.workspaceFolders.forEach(async (e) => {
for (const [name, type] of await vscode.workspace.fs.readDirectory(e.uri)) {
console.log(name);
}
});
}
return true;
}
function doNextStep() {
console.log('next step');
}