Skip to content

Commit cf95322

Browse files
committed
Allow the status bar item to be clicked again
1 parent 9fca0a4 commit cf95322

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

editors/code/src/ctx.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ export class Ctx {
289289
statusBar.tooltip.appendText(status.message ?? "Ready");
290290
statusBar.color = undefined;
291291
statusBar.backgroundColor = undefined;
292+
statusBar.command = "rust-analyzer.stopServer";
292293
break;
293294
case "warning":
294295
if (status.message) {
@@ -298,6 +299,7 @@ export class Ctx {
298299
statusBar.backgroundColor = new vscode.ThemeColor(
299300
"statusBarItem.warningBackground"
300301
);
302+
statusBar.command = "rust-analyzer.openLogs";
301303
icon = "$(warning) ";
302304
break;
303305
case "error":
@@ -306,6 +308,7 @@ export class Ctx {
306308
}
307309
statusBar.color = new vscode.ThemeColor("statusBarItem.errorForeground");
308310
statusBar.backgroundColor = new vscode.ThemeColor("statusBarItem.errorBackground");
311+
statusBar.command = "rust-analyzer.openLogs";
309312
icon = "$(error) ";
310313
break;
311314
case "stopped":
@@ -315,18 +318,19 @@ export class Ctx {
315318
);
316319
statusBar.color = undefined;
317320
statusBar.backgroundColor = undefined;
321+
statusBar.command = "rust-analyzer.startServer";
318322
statusBar.text = `$(stop-circle) rust-analyzer`;
319323
return;
320324
}
321325
if (statusBar.tooltip.value) {
322326
statusBar.tooltip.appendText("\n\n");
323327
}
324-
statusBar.tooltip.appendMarkdown("[Stop server](command:rust-analyzer.stopServer)");
325328
statusBar.tooltip.appendMarkdown(
326329
"\n\n[Reload Workspace](command:rust-analyzer.reloadWorkspace)"
327330
);
328-
statusBar.tooltip.appendMarkdown("\n\n[Restart server](command:rust-analyzer.startServer)");
329331
statusBar.tooltip.appendMarkdown("\n\n[Open logs](command:rust-analyzer.openLogs)");
332+
statusBar.tooltip.appendMarkdown("\n\n[Restart server](command:rust-analyzer.startServer)");
333+
statusBar.tooltip.appendMarkdown("[Stop server](command:rust-analyzer.stopServer)");
330334
if (!status.quiescent) icon = "$(sync~spin) ";
331335
statusBar.text = `${icon}rust-analyzer`;
332336
}

0 commit comments

Comments
 (0)