castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
424 stars 25 forks source link

Logging support unknown langId to enable trace setting #268

Open gastonmorixe opened 1 year ago

gastonmorixe commented 1 year ago

To enable vscode language server client tracing we need the langId. I couldn't find it.

Without it the "Ruby Language Server" doesn't show up on Output tab unless there's some warn/error and it's hard to debug.

{
  "solargraph.trace.server": "verbose",
}

Logging Support for Language Server If you are using vscode-languageclient to implement the client, you can specify a setting [langId].trace.server that instructs the Client to log communications between Language Client / Server to a channel of the Language Client's name. For lsp-sample, you can set this setting: "languageServerExample.trace.server": "verbose". Now head to the channel "Language Server Example". You should see the logs:

I think we should add the langId as first param here:

https://github.com/castwide/vscode-solargraph/blob/0c7987438327affebb0fcf1f1e327c6c70fc2efc/src/language-client.ts#L150

After adding 'solargraph' as first argument, tracing setting works

let client = new LanguageClient('solargraph', 'Ruby Language Server', serverOptions, clientOptions);
image