@@ -77,34 +77,35 @@ export class Ctx {
77
77
78
78
setServerStatus ( status : ServerStatusParams ) {
79
79
let icon = "" ;
80
+ const statusBar = this . statusBar ;
80
81
switch ( status . health ) {
81
82
case "ok" :
82
- this . statusBar . tooltip = status . message ?? "Ready" ;
83
- this . statusBar . command = undefined ;
84
- this . statusBar . color = undefined ;
85
- this . statusBar . backgroundColor = undefined ;
83
+ statusBar . tooltip = status . message ?? "Ready" ;
84
+ statusBar . command = undefined ;
85
+ statusBar . color = undefined ;
86
+ statusBar . backgroundColor = undefined ;
86
87
break ;
87
88
case "warning" :
88
- this . statusBar . tooltip += "\nClick to reload." ;
89
- this . statusBar . command = "rust-analyzer.reloadWorkspace" ;
90
- this . statusBar . color = new vscode . ThemeColor ( "statusBarItem.warningForeground" ) ;
91
- this . statusBar . backgroundColor = new vscode . ThemeColor (
89
+ statusBar . tooltip =
90
+ ( status . message ? status . message + "\n" : "" ) + "Click to reload." ;
91
+
92
+ statusBar . command = "rust-analyzer.reloadWorkspace" ;
93
+ statusBar . color = new vscode . ThemeColor ( "statusBarItem.warningForeground" ) ;
94
+ statusBar . backgroundColor = new vscode . ThemeColor (
92
95
"statusBarItem.warningBackground"
93
96
) ;
94
97
icon = "$(warning) " ;
95
98
break ;
96
99
case "error" :
97
- this . statusBar . tooltip += "\nClick to reload." ;
98
- this . statusBar . command = "rust-analyzer.reloadWorkspace" ;
99
- this . statusBar . color = new vscode . ThemeColor ( "statusBarItem.errorForeground" ) ;
100
- this . statusBar . backgroundColor = new vscode . ThemeColor (
101
- "statusBarItem.errorBackground"
102
- ) ;
100
+ statusBar . tooltip += "\nClick to reload." ;
101
+ statusBar . command = "rust-analyzer.reloadWorkspace" ;
102
+ statusBar . color = new vscode . ThemeColor ( "statusBarItem.errorForeground" ) ;
103
+ statusBar . backgroundColor = new vscode . ThemeColor ( "statusBarItem.errorBackground" ) ;
103
104
icon = "$(error) " ;
104
105
break ;
105
106
}
106
107
if ( ! status . quiescent ) icon = "$(sync~spin) " ;
107
- this . statusBar . text = `${ icon } rust-analyzer` ;
108
+ statusBar . text = `${ icon } rust-analyzer` ;
108
109
}
109
110
110
111
pushCleanup ( d : Disposable ) {
0 commit comments