example init
Closed this issue · 6 comments
I'm having trouble initializing vtsls using the cli. do you have an example of working initialize command that I can use.
I have tried a bunch of variation but I never get a message back.
any help would be much appreciated
Content-Length: 199
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"processId": null,
"rootUri": "file:///home/projects/tink",
"capabilities": {},
"trace": "off"
}
}
I tested your posted request in cli and the server could respond. How do you send input to the server? For my case, I create a file and redirect its content as stdin to server like tail -f <path> --bytes=+0 | vtsls --stdio
(Linux assumed). I use an editor to edit the file to ensure that line ending is \r\n
, as required in LSP spec.
I have tried using the terminal and manually pasting the message and also launching a subprocess from node as well as using tail like in your example. I don't get any response.
the same message on gopls does return a response so I think it is safe to assume the message is correctly formatted.
I also tried running the code directly and it seems onServerInitialize(conn,params) is not being called
conn.onInitialize((params) => {
return onServerInitialize(conn, params);
});
On an interesting note, typescript-language-server behaves similarly.
I'm running the command on wsl ubuntu with vtsls and ts 4.9.5 both installed globally and my node version is v16.18.1
thanks you for the support
Both this and typescript-language-server use https://github.com/microsoft/vscode-languageserver-node for protocol layer, I think this might be due to difference between that and lsp implementation of gopls. Could you test with this example language server? If it still happens, this should be an issue for vscode-languageserver-node.
same thing no response using the server sample.
I also setup a new debian wsl vm with v12.22.12 , v16.15.0 and v16.18.1 but all failed to initialize. I'm thinking it might be an issue with wsl because I ran vtsls on windows and got a message back!
my next attempt will be running a linux vm using qemu instead of wsl.
in any case it's not a vtsls problem but rather a vscode-languageserver-node issue.
btw have you tried running vtsls with socket or node-ipc instead of stdio?
I've tried node-ipc with one lsp client written with node and it works normally. Socket connection has not been tested since it is rarely needed if the server runs locally (and actually designed to).
thanks again. I will play a bit more and probably file an issue about wsl to vscode-languageserver-node repo.