Skip to content

Commit 58d8775

Browse files
authored
Make status bar item use error foreground if CLI unavailable (#2587)
1 parent 1e309c9 commit 58d8775

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

extension/src/status.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StatusBarItem, window } from 'vscode'
1+
import { StatusBarItem, ThemeColor, window } from 'vscode'
22
import { Disposable } from './class/dispose'
33
import { ICli } from './cli'
44
import { RegisteredCommands } from './commands/external'
@@ -51,6 +51,8 @@ export class Status extends Disposable {
5151

5252
private setState = (isWorking: boolean) => {
5353
this.statusBarItem.text = this.getText(isWorking)
54+
this.statusBarItem.color = this.getColor()
55+
5456
this.statusBarItem.command = this.getCommand()
5557
}
5658

@@ -66,6 +68,13 @@ export class Status extends Disposable {
6668
}
6769
}
6870

71+
private getColor() {
72+
if (this.available) {
73+
return
74+
}
75+
return new ThemeColor('errorForeground')
76+
}
77+
6978
private getCommand() {
7079
if (this.available) {
7180
return

0 commit comments

Comments
 (0)