about summary refs log tree commit diff
path: root/editors/code/src/commands.ts
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-15 11:38:44 +0000
committerbors <bors@rust-lang.org>2023-08-15 11:38:44 +0000
commitef2ee59631f9a0f62ff03b54befdef363675ceed (patch)
treea7d94f8da704a95e9f58a98d26cef7c85d92a8e3 /editors/code/src/commands.ts
parentb771de3fdc1d0eed102336c2f76ca6ced07656ac (diff)
parente76d20e072cd25ca2df21ef51e973bf666f4c840 (diff)
downloadrust-ef2ee59631f9a0f62ff03b54befdef363675ceed.tar.gz
rust-ef2ee59631f9a0f62ff03b54befdef363675ceed.zip
Auto merge of #15446 - Veykril:checkOnSaveToggle, r=Veykril
Add status bar button to toggle check on save state

Closes https://github.com/rust-lang/rust-analyzer/issues/15440
cc https://github.com/rust-lang/rust-analyzer/issues/13208
Diffstat (limited to 'editors/code/src/commands.ts')
-rw-r--r--editors/code/src/commands.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index e21f536f26a..aba37bac27d 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -1407,3 +1407,10 @@ locate()
         ctx.pushExtCleanup(document);
     };
 }
+
+export function toggleCheckOnSave(ctx: Ctx): Cmd {
+    return async () => {
+        await ctx.config.toggleCheckOnSave();
+        ctx.refreshServerStatus();
+    };
+}