Multiple language servers on one language #24100
Markiewic
started this conversation in
Language Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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