My current task involves:
async function doItAll(ownEdits: Array<TextEdit>) {
const editor: TextEditor = await getEditor();
applyOwnChanges(editor, ownEdits);
await commands.executeCommand('editor.action.organizeImports',
editor.document.uri.path);
await editor.document.save();
}
While everything is functioning correctly, the save
operation is being executed before organizeImports
completes, resulting in a dirty editor when the imports are modified.
I have meticulously checked for any missing await
keywords, but it seems like they are not being recognized. Is this possibly a bug or am I overlooking something in my approach?