-
Notifications
You must be signed in to change notification settings - Fork 408
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
Add support for LSP-standard TypeHierarchy #2769
Conversation
But keep legacy command which is still used by vscode-java. Signed-off-by: Shi Chen <[email protected]> Also-by: Mickael Istria <[email protected]>
/cc @CsCherrYY this is an adaptation of your patch in #2033 , retaining existing typehierarchy commands so those can still be used by vscode-java. This patch would allow other clients to benefit from LSP-standard type hierarchy without breaking vscode-java. |
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.
Looks fine to me.
I did notice that we don't check if the client supporst the type hierarchy client capability from initialize
, but we also don't seem to do it for the call hierarchy provider, so I guess we can leave it like this for now.
Given that Eclipse IDE intends to support, and vscode-languageclient already does (but I think we are overriding it with our delegate use) it should be fine for now.
Thank you! |
Unfortunately, build https://ci.eclipse.org/ls/job/jdt-ls-master/1789/ has failed. Is this related? |
In VS Code, we see two "show type hierarchy" menus with this PR merged. Apparently we need a client flag to control whether to register type hierarchy in init handler. |
Right. Then we definitely need it for clients to behave correctly. |
I just tried and confirm it's working well in Eclipse IDE!
I hope flag to disable standard operations will be opt-out (so clients that do support standard LSP won't have to enable anything particular, others will have to set the flag to disable LSP's standard typeHierarchy). But at this stage, wouldn't it be simpler on mid-term for VSCode-Java to also adopt the LSP official TypeHierarchy? What's missing in it to retain the legacy command? |
The standard LSP only supports supertype and subtypes, but no class hierarchy view. The current vscode-java supports 3 different views, and keep it to avoid feature loss. |
#2814 should fix the issue. |
@mickaelistria the previous approach was signalling the server provides type hierarchy without first checking whether the client supports dynamic registration. Now the spec is followed correctly with the recent PR. You can try it out to see if it still works. I think it should because I don't see |
But keep legacy command which is still used by vscode-java.
Also-by: Mickael Istria [email protected]