-
Notifications
You must be signed in to change notification settings - Fork 1
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 intellij-gno to LSP4IJ #7
Comments
Yep I see after finishing the plugin because in fact it's actually usable but the syntax highlighter is no good and LSP4IJ doesn't send the default highlighter because when I check the token received with my LSP, I see the entire code of my file in the console and not the specific token ![]() |
And what about LSP console server traces https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserGuide.md#lsp-console You should see some LSP request like and some LSP response: |
You need to set server trace as verbose in debug tab and save settings. |
It seems the ls is a copy paste from go ls. I suspect that you need to enable semantic tokens on client side like I did for go https://github.com/redhat-developer/lsp4ij/blob/main/src%2Fmain%2Fresources%2Ftemplates%2Fgopls%2FinitializationOptions.json In your case you need to override getInitualizationOptions of your StreamConnectionProvider and returns the same json than https://github.com/redhat-developer/lsp4ij/blob/main/src%2Fmain%2Fresources%2Ftemplates%2Fgopls%2FinitializationOptions.json |
Thanks, I'm going to check and see how you did it because I just tried to put in and I got the syntax highlighter but strangely it's there when I stop writing. |
Me I am using user defined ls. In your case you define your ls with extension point You will need to override the method liike I suggested. |
More exatly you need to override https://github.com/redhat-developer/lsp4ij/blob/main/src%2Fmain%2Fjava%2Fcom%2Fredhat%2Fdevtools%2Flsp4ij%2Fserver%2FStreamConnectionProvider.java#L47 in your process stream connection provider. This method must return a JqonObject or easier a Map<String, Object> that you need to fill like https://github.com/redhat-developer/lsp4ij/blob/main/src%2Fmain%2Fresources%2Ftemplates%2Fgopls%2FinitializationOptions.json |
Oh ok I understand better, thanks I going try |
I suggest really that you use LSP console with verbose trace to understand what it happens. |
Indeed it is a limitation which has already reported at redhat-developer/lsp4ij#315 Try to add in https://github.com/gnoverse/intellij-gno/blob/main/src/main/Java/com/github/intellij/gno/lsp/GnoLanguageServer.java this following code @Override
public Object getInitializationOptions(VirtualFile rootUri) {
Map<String, Object> options = new HashMap<>();
options.put("ui.semanticTokens", true);
return options;
}
|
Great!
Indeed I know this problem redhat-developer/lsp4ij#98 |
I have noticed that your plugin uses LSP4IJ, that is great!
Could you please create a PR to LSP4IJ to add it to
https://github.com/redhat-developer/lsp4ij?tab=readme-ov-file#who-is-using-lsp4ij please
And if you like LSP4IJ could you please add a review https://plugins.jetbrains.com/plugin/23257-lsp4ij/reviews to help us ro promote LSP4IJ
Thanks!
The text was updated successfully, but these errors were encountered: