Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/commands.ts')
-rw-r--r--editors/code/src/commands.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index c226aefeab..f0f9fab1c6 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -1489,3 +1489,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();
+ }
+ };
+}