Skip to content

Commit

Permalink
feat(lsp): Add option to trace LSP communication
Browse files Browse the repository at this point in the history
This option is useful to see messages passed between VS and LSP server
to debug issues in LSP server implementations.

Similar functionality is for many other languages, see e.g. previous
changes for go and rust:

golang/vscode-go@70e7c4b
https://github.com/rust-lang/rust-analyzer/pull/302/files
  • Loading branch information
hauserx committed Nov 28, 2024
1 parent 0bb1fe3 commit e63c4a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@
},
"default": [],
"description": "The arguments to pass to the LSP executable"
},
"bazel.trace.server": {
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Trace the communication between VS Code and Bazel LSP server (language server)."
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function createLsp(config: vscode.WorkspaceConfiguration) {
documentSelector: [{ scheme: "file", language: "starlark" }],
};

return new LanguageClient("Bazel LSP Client", serverOptions, clientOptions);
return new LanguageClient("bazel", "Bazel LSP Client", serverOptions, clientOptions)
}

/**
Expand Down

0 comments on commit e63c4a4

Please sign in to comment.