Skip to content

Commit

Permalink
Merge pull request #2238 from github/aeisenberg/restart-lang-server
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg authored Mar 24, 2023
2 parents 1e4672b + 2e0023f commit 23f783b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [UNRELEASED]

- 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)

## 1.8.1 - 23 March 2023

- 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)
Expand Down
10 changes: 7 additions & 3 deletions extensions/ql-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function getCommands(
app: App,
cliServer: CodeQLCliServer,
queryRunner: QueryRunner,
ideServer: LanguageClient,
): BaseCommands {
const getCliVersion = async () => {
try {
Expand All @@ -177,9 +178,12 @@ function getCommands(
"codeQL.restartQueryServer": async () =>
withProgress(
async (progress: ProgressCallback, token: CancellationToken) => {
// We restart the CLI server too, to ensure they are the same version
// Restart all of the spawned servers: cli, query, and language.
cliServer.restartCliServer();
await queryRunner.restartQueryServer(progress, token);
await Promise.all([
queryRunner.restartQueryServer(progress, token),
ideServer.restart(),
]);
void showAndLogInformationMessage("CodeQL Query Server restarted.", {
outputLogger: queryServerLogger,
});
Expand Down Expand Up @@ -889,7 +893,7 @@ async function activateWithInstalledDistribution(
void extLogger.log("Registering top-level command palette commands.");

const allCommands: AllExtensionCommands = {
...getCommands(app, cliServer, qs),
...getCommands(app, cliServer, qs, client),
...getQueryEditorCommands({
commandManager: app.commands,
queryRunner: qs,
Expand Down

0 comments on commit 23f783b

Please sign in to comment.