mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
feat: add toggleLSPLogs
command
add `toggleLSPLogs` command update docs to reflect new command
This commit is contained in:
parent
6b8b8ff4c5
commit
2ebcf55ece
5 changed files with 25 additions and 2 deletions
|
@ -1485,3 +1485,16 @@ export function toggleCheckOnSave(ctx: Ctx): Cmd {
|
|||
ctx.refreshServerStatus();
|
||||
};
|
||||
}
|
||||
|
||||
export function toggleLSPLogs(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const config = vscode.workspace.getConfiguration("rust-analyzer");
|
||||
const targetValue =
|
||||
config.get<string | undefined>("trace.server") === "verbose" ? undefined : "verbose";
|
||||
|
||||
await config.update("trace.server", targetValue, vscode.ConfigurationTarget.Workspace);
|
||||
if (targetValue && ctx.client && ctx.client.traceOutputChannel) {
|
||||
ctx.client.traceOutputChannel.show();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -177,6 +177,7 @@ function createCommands(): Record<string, CommandFactory> {
|
|||
serverVersion: { enabled: commands.serverVersion },
|
||||
viewMemoryLayout: { enabled: commands.viewMemoryLayout },
|
||||
toggleCheckOnSave: { enabled: commands.toggleCheckOnSave },
|
||||
toggleLSPLogs: { enabled: commands.toggleLSPLogs },
|
||||
// Internal commands which are invoked by the server.
|
||||
applyActionGroup: { enabled: commands.applyActionGroup },
|
||||
applySnippetWorkspaceEdit: { enabled: commands.applySnippetWorkspaceEditCommand },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue