Skip to content

Commit

Permalink
src/goLanguageServer.ts: add go.trace.server configuration
Browse files Browse the repository at this point in the history
This is available by the vscode lsp client library.
We needed to set the client id - the language server client
library to look up <client_id>.trace.server. Chose 'go' as
the client id.

Acceptable values (off, messages, verbose) are from
https://github.com/microsoft/vscode-languageserver-node/blob/b1f6a443efad3d61cf83344589099dab5318ca66/jsonrpc/src/main.ts#L207

Added this setting to package.json to allow the rich setting UI to
display it properly.

Note: this tracing is done by the lsp client, so it may be
different from the server-side logging gopls provides with
-rpc.trace options.

Change-Id: I3e33a16c953c78627e779383bba56d53ae51e8e0
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/232458
Reviewed-by: Rebecca Stambler <[email protected]>
  • Loading branch information
hyangah committed May 6, 2020
1 parent 5abbe38 commit 70e7c4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,16 @@
},
"description": "Use this setting to enable/disable experimental features from the language server."
},
"go.trace.server": {
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Trace the communication between VS Code and the Go language server."
},
"go.useGoProxyToCheckForToolUpdates": {
"type": "boolean",
"default": true,
Expand Down
3 changes: 2 additions & 1 deletion src/goLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ function buildLanguageClient(config: LanguageServerConfig) {
serverOutputChannel = vscode.window.createOutputChannel(config.serverName);
}
languageClient = new LanguageClient(
config.serverName,
'go', // id
config.serverName, // name
{
command: config.path,
args: ['-mode=stdio', ...config.flags],
Expand Down

0 comments on commit 70e7c4b

Please sign in to comment.