Skip to content

Commit 23f783b

Browse files
authored
Merge pull request #2238 from github/aeisenberg/restart-lang-server
2 parents 1e4672b + 2e0023f commit 23f783b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Restart the CodeQL language server whenever the _CodeQL: Restart Query Server_ command is invoked. This avoids bugs where the CLI version changes to support new language features, but the language server is not updated. [#2238](https://github.com/github/vscode-codeql/pull/2238)
6+
57
## 1.8.1 - 23 March 2023
68

79
- Show data flow paths of a variant analysis in a new tab. [#2172](https://github.com/github/vscode-codeql/pull/2172) & [#2182](https://github.com/github/vscode-codeql/pull/2182)

extensions/ql-vscode/src/extension.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ function getCommands(
161161
app: App,
162162
cliServer: CodeQLCliServer,
163163
queryRunner: QueryRunner,
164+
ideServer: LanguageClient,
164165
): BaseCommands {
165166
const getCliVersion = async () => {
166167
try {
@@ -177,9 +178,12 @@ function getCommands(
177178
"codeQL.restartQueryServer": async () =>
178179
withProgress(
179180
async (progress: ProgressCallback, token: CancellationToken) => {
180-
// We restart the CLI server too, to ensure they are the same version
181+
// Restart all of the spawned servers: cli, query, and language.
181182
cliServer.restartCliServer();
182-
await queryRunner.restartQueryServer(progress, token);
183+
await Promise.all([
184+
queryRunner.restartQueryServer(progress, token),
185+
ideServer.restart(),
186+
]);
183187
void showAndLogInformationMessage("CodeQL Query Server restarted.", {
184188
outputLogger: queryServerLogger,
185189
});
@@ -889,7 +893,7 @@ async function activateWithInstalledDistribution(
889893
void extLogger.log("Registering top-level command palette commands.");
890894

891895
const allCommands: AllExtensionCommands = {
892-
...getCommands(app, cliServer, qs),
896+
...getCommands(app, cliServer, qs, client),
893897
...getQueryEditorCommands({
894898
commandManager: app.commands,
895899
queryRunner: qs,

0 commit comments

Comments
 (0)