generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lsp/extension to show build status for failures and errs (#1830)
Fixes #1808 https://github.com/TBD54566975/ftl/assets/31338/54e6f71e-1ad5-4ef0-9b03-630a8ae428f5 --------- Co-authored-by: Alec Thomas <[email protected]>
- Loading branch information
1 parent
9941e4b
commit 6e2a7d2
Showing
7 changed files
with
152 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,49 @@ | ||
import * as vscode from 'vscode' | ||
|
||
const resetColors = (statusBarItem: vscode.StatusBarItem) => { | ||
statusBarItem.backgroundColor = undefined | ||
statusBarItem.color = undefined | ||
} | ||
|
||
const errorColors = (statusBarItem: vscode.StatusBarItem) => { | ||
statusBarItem.backgroundColor = new vscode.ThemeColor('statusBarItem.errorBackground') | ||
statusBarItem.color = new vscode.ThemeColor('statusBarItem.errorForeground') | ||
} | ||
|
||
const loadingColors = (statusBarItem: vscode.StatusBarItem) => { | ||
statusBarItem.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground') | ||
statusBarItem.color = new vscode.ThemeColor('statusBarItem.warningForeground') | ||
} | ||
|
||
export const FTLStatus = { | ||
starting: (statusBarItem: vscode.StatusBarItem) => { | ||
ftlStarting: (statusBarItem: vscode.StatusBarItem) => { | ||
loadingColors(statusBarItem) | ||
statusBarItem.text = `$(sync~spin) FTL` | ||
statusBarItem.tooltip = 'FTL is starting...' | ||
}, | ||
started: (statusBarItem: vscode.StatusBarItem) => { | ||
statusBarItem.text = `$(zap) FTL` | ||
statusBarItem.tooltip = 'FTL is running.' | ||
}, | ||
stopped: (statusBarItem: vscode.StatusBarItem) => { | ||
ftlStopped: (statusBarItem: vscode.StatusBarItem) => { | ||
resetColors(statusBarItem) | ||
statusBarItem.text = `$(primitive-square) FTL` | ||
statusBarItem.tooltip = 'FTL is stopped.' | ||
}, | ||
error: (statusBarItem: vscode.StatusBarItem, message: string) => { | ||
ftlError: (statusBarItem: vscode.StatusBarItem, message: string) => { | ||
errorColors(statusBarItem) | ||
statusBarItem.text = `$(error) FTL` | ||
statusBarItem.tooltip = message | ||
} | ||
}, | ||
buildRunning: (statusBarItem: vscode.StatusBarItem) => { | ||
loadingColors(statusBarItem) | ||
statusBarItem.text = `$(gear~spin) FTL` | ||
statusBarItem.tooltip = 'FTL project building...' | ||
}, | ||
buildOK: (statusBarItem: vscode.StatusBarItem) => { | ||
resetColors(statusBarItem) | ||
statusBarItem.text = `$(zap) FTL` | ||
statusBarItem.tooltip = 'FTL project is successfully built.' | ||
}, | ||
buildError: (statusBarItem: vscode.StatusBarItem, message: string) => { | ||
errorColors(statusBarItem) | ||
statusBarItem.text = `$(error) FTL` | ||
statusBarItem.tooltip = message | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters