Skip to content

Commit 825823c

Browse files
angelozerrdatho7561
authored andcommitted
Move to vscode-languageclient 8.0.1
Fixes #711 Signed-off-by: azerr <[email protected]>
1 parent 0562653 commit 825823c

File tree

5 files changed

+53
-45
lines changed

5 files changed

+53
-45
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"minimist": ">=1.2.6",
9090
"serialize-javascript": "^4.0.0",
9191
"ts-loader": "^9.3.1",
92-
"typescript": "^4.7.4",
92+
"typescript": "^4.9.4",
9393
"vscode-test": "^1.2.0",
9494
"webpack": "^5.28.0",
9595
"webpack-cli": "^4.6.0"
@@ -101,7 +101,7 @@
101101
"glob": "^7.1.4",
102102
"jdk-utils": "^0.4.3",
103103
"path-exists": "^4.0.0",
104-
"vscode-languageclient": "^7.0.0",
104+
"vscode-languageclient": "^8.0.1",
105105
"yauzl": "^2.10.0"
106106
},
107107
"contributes": {

src/client/clientErrorHandler.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as fs from "fs-extra";
22
import { commands, ConfigurationTarget, ExtensionContext, window, workspace } from "vscode";
3-
import { CloseAction, ErrorAction, ErrorHandler, Message } from "vscode-languageclient";
3+
import { CloseAction, CloseHandlerResult, ErrorAction, ErrorHandler, ErrorHandlerResult, Message } from "vscode-languageclient";
44
import * as ClientCommandConstants from "../commands/clientCommandConstants";
55
import { HEAP_DUMP_LOCATION } from "../server/java/jvmArguments";
66
import * as Telemetry from "../telemetry";
@@ -28,11 +28,19 @@ export class ClientErrorHandler implements ErrorHandler {
2828
this.heapDumpFolder = getHeapDumpFolderFromSettings() || context.globalStorageUri.fsPath;
2929
}
3030

31-
error(_error: Error, _message: Message, _count: number): ErrorAction {
32-
return ErrorAction.Continue;
31+
error(_error: Error, _message: Message, _count: number): ErrorHandlerResult {
32+
return {
33+
action: ErrorAction.Continue
34+
};
3335
}
3436

35-
closed(): CloseAction {
37+
closed(): CloseHandlerResult {
38+
return {
39+
action: this.doClosed()
40+
}
41+
}
42+
43+
doClosed(): CloseAction {
3644
this.restarts.push(Date.now());
3745
const heapProfileGlob = new glob.GlobSync(`${this.heapDumpFolder}/java_*.hprof`);
3846
if (heapProfileGlob.found.length) {

src/client/xmlClient.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ export async function startLanguageClient(context: ExtensionContext, executable:
5252
}
5353
});
5454

55-
context.subscriptions.push(languageClient.start());
56-
await languageClient.onReady();
55+
await languageClient.start();
5756

5857
// ---
5958

@@ -146,8 +145,7 @@ function getLanguageClientOptions(
146145
},
147146
actionableNotificationSupport: true,
148147
openSettingsCommandSupport: true,
149-
bindingWizardSupport: true,
150-
shouldLanguageServerExitOnShutdown: true
148+
bindingWizardSupport: true
151149
}
152150
},
153151
errorHandler: new ClientErrorHandler('XML', context),
@@ -158,8 +156,9 @@ function getLanguageClientOptions(
158156
middleware: {
159157
workspace: {
160158
didChangeConfiguration: () => {
161-
languageClient.sendNotification(DidChangeConfigurationNotification.type, { settings: getXMLSettings(requirementsData.java_home, logfile, externalXmlSettings) });
159+
const result = languageClient.sendNotification(DidChangeConfigurationNotification.type, { settings: getXMLSettings(requirementsData.java_home, logfile, externalXmlSettings) });
162160
onConfigurationChange();
161+
return result;
163162
}
164163
}
165164
}

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ export async function activate(context: ExtensionContext): Promise<XMLExtensionA
6666
export async function deactivate(): Promise<void> {
6767
if (languageClient) {
6868
await languageClient.stop();
69+
languageClient = undefined;
6970
}
7071
}

0 commit comments

Comments
 (0)