diff options
| author | dfireBird <me@dfirebird.dev> | 2023-10-04 10:14:03 +0530 |
|---|---|---|
| committer | dfireBird <me@dfirebird.dev> | 2023-10-04 21:07:50 +0530 |
| commit | ab091b73d0117d9788549289d3cd1ac709b462dd (patch) | |
| tree | fb5dabff0936946bf093738277acb7c1ca1ed45d /editors/code/src | |
| parent | 7b8330f2837961e01ce643cd204943d2967debab (diff) | |
| download | rust-ab091b73d0117d9788549289d3cd1ac709b462dd.tar.gz rust-ab091b73d0117d9788549289d3cd1ac709b462dd.zip | |
Add config for the default click action of extension status bar
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/config.ts | 4 | ||||
| -rw-r--r-- | editors/code/src/ctx.ts | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 9821aee6f92..987d936943a 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -329,6 +329,10 @@ export class Config { get showDependenciesExplorer() { return this.get<boolean>("showDependenciesExplorer"); } + + get statusBarClickAction() { + return this.get<string>("statusBar.clickAction"); + } } // the optional `cb?` parameter is meant to be used to add additional diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 904efa4d5eb..84d1ad98bd9 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -400,7 +400,11 @@ export class Ctx { statusBar.tooltip.appendText(status.message ?? "Ready"); statusBar.color = undefined; statusBar.backgroundColor = undefined; - statusBar.command = "rust-analyzer.openLogs"; + if (this.config.statusBarClickAction === "stopServer") { + statusBar.command = "rust-analyzer.stopServer"; + } else { + statusBar.command = "rust-analyzer.openLogs"; + } this.dependencies?.refresh(); break; case "warning": |
