Skip to content

Commit c9e87ef

Browse files
author
Alexander Eyers-Taylor
committed
Update languageserver-client
1 parent 56af69e commit c9e87ef

6 files changed

Lines changed: 57 additions & 53 deletions

File tree

extensions/ql-vscode/package-lock.json

Lines changed: 45 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"url": "https://github.com/github/vscode-codeql"
1414
},
1515
"engines": {
16-
"vscode": "^1.59.0",
16+
"vscode": "^1.67.0",
1717
"node": "^16.13.0",
1818
"npm": ">=7.20.6"
1919
},
@@ -1296,7 +1296,7 @@
12961296
"unzipper": "~0.10.5",
12971297
"vscode-extension-telemetry": "^0.1.6",
12981298
"vscode-jsonrpc": "^5.0.1",
1299-
"vscode-languageclient": "^6.1.3",
1299+
"vscode-languageclient": "^8.0.2",
13001300
"vscode-test-adapter-api": "~1.7.0",
13011301
"vscode-test-adapter-util": "~0.7.0",
13021302
"zip-a-folder": "~1.1.3"

extensions/ql-vscode/src/extension.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
workspace,
1919
ProviderResult
2020
} from 'vscode';
21-
import { LanguageClient } from 'vscode-languageclient';
21+
import { LanguageClient } from 'vscode-languageclient/node';
2222
import * as os from 'os';
2323
import * as fs from 'fs-extra';
2424
import * as path from 'path';
@@ -1130,8 +1130,10 @@ async function activateWithInstalledDistribution(
11301130
ctx.subscriptions.push(new SummaryLanguageSupport());
11311131

11321132
void logger.log('Starting language server.');
1133-
ctx.subscriptions.push(client.start());
1134-
1133+
await client.start();
1134+
ctx.subscriptions.push({
1135+
dispose: () => { void client.stop(); }
1136+
});
11351137
// Jump-to-definition and find-references
11361138
void logger.log('Registering jump-to-definition handlers.');
11371139

extensions/ql-vscode/src/ide-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ProgressLocation, window } from 'vscode';
2-
import { StreamInfo } from 'vscode-languageclient';
2+
import { StreamInfo } from 'vscode-languageclient/node';
33
import * as cli from './cli';
44
import { QueryServerConfig } from './config';
55
import { ideServerLogger } from './logging';

extensions/ql-vscode/src/legacy-query-server/run-queries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
CancellationToken,
77
Uri,
88
} from 'vscode';
9-
import { ErrorCodes, ResponseError } from 'vscode-languageclient';
9+
import { LSPErrorCodes, ResponseError } from 'vscode-languageclient';
1010

1111
import * as cli from '../cli';
1212
import { DatabaseItem, } from '../databases';
@@ -400,7 +400,7 @@ export async function compileAndRunQueryAgainstDatabase(
400400
try {
401401
errors = await query.compile(qs, qlProgram, progress, token);
402402
} catch (e) {
403-
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
403+
if (e instanceof ResponseError && e.code == LSPErrorCodes.RequestCancelled) {
404404
return createSyntheticResult(query, 'Query cancelled');
405405
} else {
406406
throw e;

extensions/ql-vscode/src/quick-query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
workspace,
99
Uri
1010
} from 'vscode';
11-
import { ErrorCodes, ResponseError } from 'vscode-languageclient';
11+
import { LSPErrorCodes, ResponseError } from 'vscode-languageclient';
1212
import { CodeQLCliServer } from './cli';
1313
import { DatabaseUI } from './databases-ui';
1414
import {
@@ -139,7 +139,7 @@ export async function displayQuickQuery(
139139

140140
await Window.showTextDocument(await workspace.openTextDocument(qlFile));
141141
} catch (e) {
142-
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
142+
if (e instanceof ResponseError && e.code == LSPErrorCodes.RequestCancelled) {
143143
throw new UserCancellationException(getErrorMessage(e));
144144
} else {
145145
throw e;

0 commit comments

Comments
 (0)