Skip to content

Commit

Permalink
feat(lsp): Add option to trace LSP communication (#425)
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 authored Nov 28, 2024
1 parent 0bb1fe3 commit 583fb65
Show file tree
Hide file tree
Showing 2 changed files with 16 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
7 changes: 6 additions & 1 deletion src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ 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 583fb65

Please sign in to comment.