You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are not LSP client agnostic (require the use of vscode APIs)
Since the goal of the LSP is to provide access to any language's parsed and analyzed content in a standard way, I believe that it should be the language server's job to get all the information it needs through the other language servers.
Possible solutions
Get the running LSP server addresses with their corresponding language.
During initialization, the server says it will need access to the LSP server for languageID.
The client sends the other language's server address in every request.
The server can then fetch this other server for all the data it needs.
The data is requested through the client, which acts as a Proxy.
A method from the server can be forwarded to the other language server, by sending an englobing request:
{
method: "forward/css", // or any other language id
params: {
method: "some/forwarded/method",
params: {
// ...
}
}
With this solution, two servers can communicate one with the other without having to implement any of the client functionality.
Examples
VHDL <-> Verilog <-> System Verilog
These can be used together without bindings, and language servers fail to resolve available variables coming from other languages, even though they are available. This would be fixed by asking the other language servers for the variables they export.
JS <- JSON
Currently, AFAIK there is no JSON LSP, but reading JSON is embedded into the JS LSP. That means when a json file is imported, we get autocompletion for its data from within JS.
However, did we have a language server specifically for JSON, there would be no way to get the available keys for the JS LSP server, without it reimplementing the JS functionality.
The case of all bindings based inter language communication:
All of these break the single source of truth principle by creating bindings, but at least they get editor auto complete. This may be a viable option for some languages, but definitely not for all.
... To be continued, will write more tomorrow.
The text was updated successfully, but these errors were encountered:
The current state of inter lsp servers communication leaves much to be desired. Indeed there are embedded language services and request forwarding, but these
Since the goal of the LSP is to provide access to any language's parsed and analyzed content in a standard way, I believe that it should be the language server's job to get all the information it needs through the other language servers.
Possible solutions
languageID
.With this solution, two servers can communicate one with the other without having to implement any of the client functionality.
Examples
VHDL <-> Verilog <-> System Verilog
These can be used together without bindings, and language servers fail to resolve available variables coming from other languages, even though they are available. This would be fixed by asking the other language servers for the variables they export.
JS <- JSON
Currently, AFAIK there is no JSON LSP, but reading JSON is embedded into the JS LSP. That means when a json file is
import
ed, we get autocompletion for its data from within JS.However, did we have a language server specifically for JSON, there would be no way to get the available keys for the JS LSP server, without it reimplementing the JS functionality.
The case of all bindings based inter language communication:
All of these break the single source of truth principle by creating bindings, but at least they get editor auto complete. This may be a viable option for some languages, but definitely not for all.
The text was updated successfully, but these errors were encountered: