मैं दो कार्य किया है: doAsyncStuff और doNextStep. कैसे कर सकते हैं मैं सुरक्षित doNextStep करने के लिए क्रियान्वित किया जा के बाद ही doAsyncStuff समाप्त हो गया है?
मैं कुछ करने की कोशिश की तरह है, लेकिन यह मदद नहीं की: 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');
}