Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use error foreground for status bar item color if CLI unavailable #2587

Merged
merged 3 commits into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion extension/src/status.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StatusBarItem, window } from 'vscode'
import { StatusBarItem, ThemeColor, window } from 'vscode'
import { Disposable } from './class/dispose'
import { ICli } from './cli'
import { RegisteredCommands } from './commands/external'
Expand Down Expand Up @@ -51,6 +51,8 @@ export class Status extends Disposable {

private setState = (isWorking: boolean) => {
this.statusBarItem.text = this.getText(isWorking)
this.statusBarItem.color = this.getColor()

this.statusBarItem.command = this.getCommand()
}

Expand All @@ -66,6 +68,13 @@ export class Status extends Disposable {
}
}

private getColor() {
if (this.available) {
return
}
return new ThemeColor('errorForeground')
}

private getCommand() {
if (this.available) {
return
Expand Down