diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 428e2899f41..e82b018883b 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Fix bug where a query is sometimes run before the file is saved. [#947](https://github.com/github/vscode-codeql/pull/947) + ## 1.5.4 - 02 September 2021 - Add support for filename pattern in history view. [#930](https://github.com/github/vscode-codeql/pull/930) diff --git a/extensions/ql-vscode/src/run-queries.ts b/extensions/ql-vscode/src/run-queries.ts index bed870de29c..d7c4d46b68a 100644 --- a/extensions/ql-vscode/src/run-queries.ts +++ b/extensions/ql-vscode/src/run-queries.ts @@ -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(); } }