Skip to content

Commit 4f568ea

Browse files
hmacshati-patel
authored andcommitted
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.
1 parent 6d41362 commit 4f568ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/ql-vscode/src/run-queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export async function determineSelectedQuery(selectedResourceUri: Uri | undefine
524524
// then prompt the user to save it first.
525525
if (editor !== undefined && editor.document.uri.fsPath === queryPath) {
526526
if (await promptUserToSaveChanges(editor.document)) {
527-
void editor.document.save();
527+
await editor.document.save();
528528
}
529529
}
530530

0 commit comments

Comments
 (0)