Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade LSP related packages #460

Merged
merged 3 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"author": "chenglou",
"license": "MIT",
"dependencies": {
"vscode-languageclient": "^7.0.0"
"vscode-languageclient": "^8.0.1"
}
}
35 changes: 20 additions & 15 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
LanguageClient,
LanguageClientOptions,
ServerOptions,
State,
TransportKind,
} from "vscode-languageclient/node";

Expand Down Expand Up @@ -113,19 +114,23 @@ export function activate(context: ExtensionContext) {
// compilation has finished, and the most reliable source for that is the LS
// server, that already keeps track of when the compiler finishes in order to
// other provide fresh diagnostics.
client.onReady().then(() => {
context.subscriptions.push(
client.onNotification("rescript/compilationFinished", () => {
if (inCodeAnalysisState.active === true) {
customCommands.codeAnalysisWithReanalyze(
inCodeAnalysisState.activatedFromDirectory,
diagnosticsCollection,
diagnosticsResultCodeActions
);
}
})
);
});
context.subscriptions.push(
client.onDidChangeState(({ newState }) => {
if (newState === State.Running) {
context.subscriptions.push(
client.onNotification("rescript/compilationFinished", () => {
if (inCodeAnalysisState.active === true) {
customCommands.codeAnalysisWithReanalyze(
inCodeAnalysisState.activatedFromDirectory,
diagnosticsCollection,
diagnosticsResultCodeActions
);
}
})
);
}
})
);

return client;
}
Expand Down Expand Up @@ -223,12 +228,12 @@ export function activate(context: ExtensionContext) {
commands.registerCommand("rescript-vscode.restart_language_server", () => {
client.stop().then(() => {
client = createLanguageClient();
context.subscriptions.push(client.start());
client.start();
});
});

// Start the client. This will also launch the server
context.subscriptions.push(client.start());
client.start();

// Autostart code analysis if wanted
if (
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"language-server"
],
"engines": {
"vscode": "^1.55.0"
"vscode": "^1.68.0"
},
"activationEvents": [
"onLanguage:rescript"
Expand Down Expand Up @@ -164,7 +164,7 @@
},
"devDependencies": {
"@types/node": "^14.14.41",
"@types/vscode": "1.55.0",
"typescript": "^4.2.4"
"@types/vscode": "1.68.0",
"typescript": "^4.7.3"
}
}
83 changes: 34 additions & 49 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading