Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/ctx.ts')
| -rw-r--r-- | editors/code/src/ctx.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 044a9470aa..8592950e10 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -204,13 +204,13 @@ export class Ctx { } } - setServerStatus(status: ServerStatusParams) { + setServerStatus(status: ServerStatusParams | { health: "stopped" }) { let icon = ""; const statusBar = this.statusBar; switch (status.health) { case "ok": - statusBar.tooltip = status.message ?? "Ready"; - statusBar.command = undefined; + statusBar.tooltip = (status.message ?? "Ready") + "Click to stop."; + statusBar.command = "rust-analyzer.stopServer"; statusBar.color = undefined; statusBar.backgroundColor = undefined; break; @@ -234,6 +234,13 @@ export class Ctx { statusBar.backgroundColor = new vscode.ThemeColor("statusBarItem.errorBackground"); icon = "$(error) "; break; + case "stopped": + statusBar.tooltip = "Server is stopped. Click to start."; + statusBar.command = "rust-analyzer.startServer"; + statusBar.color = undefined; + statusBar.backgroundColor = undefined; + statusBar.text = `$(stop-circle) rust-analyzer`; + return; } if (!status.quiescent) icon = "$(sync~spin) "; statusBar.text = `${icon}rust-analyzer`; |