Wait for document to be saved before running query

This prevents a race condition where the query runs before the editor has saved the file.
This commit is contained in:
Harry Maclean
2021-09-07 14:35:55 +01:00
committed by Shati Patel
parent 6d41362251
commit 4f568ea331

View File

@@ -524,7 +524,7 @@ export async function determineSelectedQuery(selectedResourceUri: Uri | undefine
// then prompt the user to save it first.
if (editor !== undefined && editor.document.uri.fsPath === queryPath) {
if (await promptUserToSaveChanges(editor.document)) {
void editor.document.save();
await editor.document.save();
}
}