mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Show workspace info in the status bar
This commit is contained in:
parent
56bee2ddaf
commit
18ca22a98e
15 changed files with 168 additions and 81 deletions
|
@ -433,7 +433,6 @@ export class Ctx implements RustAnalyzerExtensionApi {
|
|||
statusBar.tooltip.isTrusted = true;
|
||||
switch (status.health) {
|
||||
case "ok":
|
||||
statusBar.tooltip.appendText(status.message ?? "Ready");
|
||||
statusBar.color = undefined;
|
||||
statusBar.backgroundColor = undefined;
|
||||
if (this.config.statusBarClickAction === "stopServer") {
|
||||
|
@ -444,9 +443,6 @@ export class Ctx implements RustAnalyzerExtensionApi {
|
|||
this.dependencies?.refresh();
|
||||
break;
|
||||
case "warning":
|
||||
if (status.message) {
|
||||
statusBar.tooltip.appendText(status.message);
|
||||
}
|
||||
statusBar.color = new vscode.ThemeColor("statusBarItem.warningForeground");
|
||||
statusBar.backgroundColor = new vscode.ThemeColor(
|
||||
"statusBarItem.warningBackground",
|
||||
|
@ -455,9 +451,6 @@ export class Ctx implements RustAnalyzerExtensionApi {
|
|||
icon = "$(warning) ";
|
||||
break;
|
||||
case "error":
|
||||
if (status.message) {
|
||||
statusBar.tooltip.appendText(status.message);
|
||||
}
|
||||
statusBar.color = new vscode.ThemeColor("statusBarItem.errorForeground");
|
||||
statusBar.backgroundColor = new vscode.ThemeColor("statusBarItem.errorBackground");
|
||||
statusBar.command = "rust-analyzer.openLogs";
|
||||
|
@ -476,6 +469,15 @@ export class Ctx implements RustAnalyzerExtensionApi {
|
|||
statusBar.text = "$(stop-circle) rust-analyzer";
|
||||
return;
|
||||
}
|
||||
if (status.message) {
|
||||
statusBar.tooltip.appendText(status.message);
|
||||
}
|
||||
if (status.workspaceInfo) {
|
||||
if (statusBar.tooltip.value) {
|
||||
statusBar.tooltip.appendMarkdown("\n\n---\n\n");
|
||||
}
|
||||
statusBar.tooltip.appendMarkdown(status.workspaceInfo);
|
||||
}
|
||||
if (statusBar.tooltip.value) {
|
||||
statusBar.tooltip.appendMarkdown("\n\n---\n\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue