Multiple language servers on one language #24100
Replies: 5 comments 3 replies
-
@maxdeviant now the angular extension is live, this issue sticks out as the final block to parity with VSCode's offering. See link below, which contains a short video showing the issue in practice. Basically, 'go to definition' functionality seems to only stop at the first language server in whatever has been configured... If I tagged the wrong person, could you point at to someone who can at least outline the limitation, or point us in the right direction to see if we can attempt a PR for this? Thanks a lot |
Beta Was this translation helpful? Give feedback.
-
Wanted to link an additional related discussion: Currently the only way to by-default specify which extension provided LSP is "primary" for a given language (without requiring users to change their settings) is Zed shipping hard coded defaults in the global CC: @DavisVaughan, @lict99, @P1n3appl3 |
Beta Was this translation helpful? Give feedback.
-
Could this project be helpful for this? https://github.com/thefrontside/lspx |
Beta Was this translation helpful? Give feedback.
-
Just in case people didn't get notified, a member of the Angular core team was nice enough to chip in here: Does this allow us to focus a simpler initial implementation to accommodate this? To date, any angular developers using zed are limping along without the same functionality that can be enjoyed in VSCode. Maybe an interim solution can be deployed without having to do a big rewrite or extension of functionality. |
Beta Was this translation helpful? Give feedback.
-
Just realized... instead of thinking of this on the language level, we can think of this instead on the glob level. Then, this whole 'multiple language server' multiplexing discussion can be defferred to another day. Angular dev right now on Zed is a pain really due to the fact that the Instead, I use With a glob-based override, developers (whether using external or internal templating) can then add a simple rule that will direct all files or a folder containing their angular project directly to the My config (now):
My config (with new configurability)
This solves the problem quickly, while releasing pressure on the above discussion. Can we move forward on this to begin? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on an extension for Angular support. As you know, Angular does not use any of its own file extensions (like vue, for example), but uses files with the
.ts
and.html
extensions.So, now Zed correctly recognizes the language of the opened files (HTML and TypeScript).
We specified the following configuration in extension.toml:
This means that if the file has the
html
language selected, then two language servers will work for it:vscode-html-language-server
and ourangular
server. And indeed: functions such as hovering (thetextDocument/hover
method) work correctly, information is requested from both language servers and combined. Where there is something to tell thevscode-html-language-server
server, information from it is displayed, and the same for theangular
server.But there is a problem with the "Go to definition" function. The
angular
server does not receive thetextDocument/definition
message at all. If you check what messagesvscode-html-language-server
receives, these messages are there (and it is logical that it responds with an empty array).The same situation is with TS files. The
vtsls
language server receivestextDocument/definition
messages, but angular does not. Although such functions as auto-completion and hover work correctly.It is possible to set in the user settings which language servers will be used for a particular language. And what is interesting is that if you set them like this:
then everything will start working correctly. Yes, now it is the other way around, the
vscode-html-language-server
andvtsls
servers stopped receivingtextDocument/definition
messages, butangular
does.The same applies to the
textDocument/references
andtextDocument/rename
methods. It turns out that these features only work for the language server that is listed first.In this regard, I have two questions:
angular
language server as a priority using the extension configuration? It is probably incorrect to ask the user to manually set the necessary settings after installation.Beta Was this translation helpful? Give feedback.
All reactions