-
Notifications
You must be signed in to change notification settings - Fork 441
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
Update language-client to 8.1.0 #2377
Update language-client to 8.1.0 #2377
Conversation
2b356eb
to
7d6fb9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I ran into a problem updating to the language client to 8.0.1 in vscode-xml, and I suspect it'll be the same here. The extension will break on Theia. Note: Node 14 needs to be used as with 12, I ran into
If I'm understanding how the So the act of referencing the language client causes TypeHierarchyItem to be referenced, which Theia does not support CC'ing @fbricon , @testforstephen in case I'm missing an obvious way to work around this. |
@rgrunber Yeah I had opened an issue here: eclipse-theia/theia#10993, it seems Theia should support the related types (e.g., TypeHierarchyItem). |
We should re-investigate this soon. Once Theia releases, I'm hoping this will work. It seems they recently started supporting the Type Hierarchy API. https://eclipse-theia.github.io/vscode-theia-comparator/status.html |
it seems that Theia has released a new version 1.31.0 which supports TypeHierarchyItem: https://github.com/eclipse-theia/theia/blob/master/CHANGELOG.md#breaking_changes_1.31.0 I will update the PR these days. |
I may have been a bit too optimistic. We will still need to wait for the end of the year to be able to make this change, but at least it will happen eventually :( |
@rgrunber is there anything I miss about this change? One concern is that we seem not to have a way to define the required Theia version in package.json, since only the newest Theia supports this API. |
7d6fb9a
to
9b1e44f
Compare
6842d55 updates the language client to newest 8.0.2. Comparing it with the former 8.0.0-next 4, the changes can be found also in https://github.com/microsoft/vscode-languageserver-node#3170-protocol-800-json-rpc-800-client-and-800-server:
cc @rgrunber |
8e71654
to
6f6414d
Compare
maybe eclipse-jdtls/eclipse.jdt.ls#1790 is related. @rgrunber could you provide any comments? |
@datho7561 It seems that if we disable the client capability @rgrunber If it's true, I guess language client 8+ has fixed what we patch in eclipse-jdtls/eclipse.jdt.ls#1790. |
c5afa60
to
c7455ae
Compare
Yes, i think this is the right fix. This is what we did in redhat-developer/vscode-xml@825823c for vscode-xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After shouldLanguageServerExitOnShutdown
is removed/set to false, I think this PR will be good
src/providerDispatcher.ts
Outdated
@@ -99,10 +99,10 @@ function createDocumentSymbolProvider(): DocumentSymbolProvider { | |||
} | |||
|
|||
if ((<any>symbolResponse[0]).containerName) { | |||
return languageClient.protocol2CodeConverter.asSymbolInformations(<clientSymbolInformation[]>symbolResponse); | |||
return await languageClient.protocol2CodeConverter.asSymbolInformations(<clientSymbolInformation[]>symbolResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the result of the protocol2CodeConverter
is a Promise
, I think you should be able to return the Promise
without using await
and it will do the same thing. (this isn't a big deal though).
BTW, dose the new version of language client has native support of inlay hint? If yes, maybe we can remove https://github.com/redhat-developer/vscode-java/blob/master/src/inlayHintsProvider.ts and its related code. |
@jdneo I guess the anwser is yes. See: https://github.com/microsoft/vscode-languageserver-node#3170-protocol-800-json-rpc-800-client-and-800-server inlay hint support is in the list here. I also find the related types in the language-client library. |
it looks like |
Signed-off-by: Shi Chen <chenshi@microsoft.com>
Signed-off-by: Shi Chen <chenshi@microsoft.com>
Signed-off-by: Shi Chen <chenshi@microsoft.com>
7c28e29
to
9c2074c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks fine (with the lsp4j 0.20.0 PR in JDT-LS). I tried out rename, codelens, inlay hints, type hierarchy as those seem to be more at risk for breakage. It all seems to work well. The syntax server shuts down on its own as well.
I did noticed : https://github.com/redhat-developer/vscode-java/actions/runs/4200047119/jobs/7285652596#step:9:13 . The build still passes. Is this safe ?
src/extension.ts
Outdated
// https://github.com/redhat-developer/vscode-java/pull/2377#issuecomment-1427268344 | ||
shouldLanguageServerExitOnShutdown: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was fixed in the language client release that supported 3.17. Original issue is at #1928 (comment) . There's no need to set it to false as that's the default value anyways on the server side. In fact, there's a good argument for getting rid of it entirely since it was really to handle some non-protocol behaviour.
@rgrunber |
Ok, then let's go ahead and update typescript here if that will fix it. |
Signed-off-by: Shi Chen <chenshi@microsoft.com>
@@ -1397,7 +1397,7 @@ | |||
"@types/glob": "5.0.30", | |||
"@types/lodash.findindex": "^4.6.6", | |||
"@types/mocha": "^5.2.5", | |||
"@types/node": "^8.10.51", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since VS Code has switched to node 16 since 1.66 (https://code.visualstudio.com/updates/v1_66#_nodemoduleversion-and-nodejs-api-update), let's update this deps as well. The update will resolve the following error:
node_modules/vscode-jsonrpc/lib/node/main.d.ts(8,37): error TS2307: Cannot find module 'worker_threads' or its corresponding type declarations.
Signed-off-by: Shi Chen <chenshi@microsoft.com>
@rgrunber it looks like that issue got resolved after updating typescript and node :) |
This PR is a part of #2376, to reduce the complexity of that PR. Type Hierarchy support has been introduced since language-client 8.0.0-next.4 so we should update this dependency, the language-client version requires vscode 1.61.0 for compiling, so I update this dependency as well.
sendNotification
methods will return a promise.This update is incompatible with current Theia. see: eclipse-theia/theia#10993