Restart language server on command
Ensure that the language server is restarted when the "Restart Query Server" command is invoked.
This commit is contained in:
Родитель
d35ab77aaf
Коммит
2e0023fb3c
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## [UNRELEASED]
|
## [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
|
## 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)
|
- 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)
|
||||||
|
|
|
@ -161,6 +161,7 @@ function getCommands(
|
||||||
app: App,
|
app: App,
|
||||||
cliServer: CodeQLCliServer,
|
cliServer: CodeQLCliServer,
|
||||||
queryRunner: QueryRunner,
|
queryRunner: QueryRunner,
|
||||||
|
ideServer: LanguageClient,
|
||||||
): BaseCommands {
|
): BaseCommands {
|
||||||
const getCliVersion = async () => {
|
const getCliVersion = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -177,9 +178,12 @@ function getCommands(
|
||||||
"codeQL.restartQueryServer": async () =>
|
"codeQL.restartQueryServer": async () =>
|
||||||
withProgress(
|
withProgress(
|
||||||
async (progress: ProgressCallback, token: CancellationToken) => {
|
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();
|
cliServer.restartCliServer();
|
||||||
await queryRunner.restartQueryServer(progress, token);
|
await Promise.all([
|
||||||
|
queryRunner.restartQueryServer(progress, token),
|
||||||
|
ideServer.restart(),
|
||||||
|
]);
|
||||||
void showAndLogInformationMessage("CodeQL Query Server restarted.", {
|
void showAndLogInformationMessage("CodeQL Query Server restarted.", {
|
||||||
outputLogger: queryServerLogger,
|
outputLogger: queryServerLogger,
|
||||||
});
|
});
|
||||||
|
@ -889,7 +893,7 @@ async function activateWithInstalledDistribution(
|
||||||
void extLogger.log("Registering top-level command palette commands.");
|
void extLogger.log("Registering top-level command palette commands.");
|
||||||
|
|
||||||
const allCommands: AllExtensionCommands = {
|
const allCommands: AllExtensionCommands = {
|
||||||
...getCommands(app, cliServer, qs),
|
...getCommands(app, cliServer, qs, client),
|
||||||
...getQueryEditorCommands({
|
...getQueryEditorCommands({
|
||||||
commandManager: app.commands,
|
commandManager: app.commands,
|
||||||
queryRunner: qs,
|
queryRunner: qs,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче