File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -204,13 +204,13 @@ export class Ctx {
204
204
}
205
205
}
206
206
207
- setServerStatus ( status : ServerStatusParams ) {
207
+ setServerStatus ( status : ServerStatusParams | { health : "stopped" } ) {
208
208
let icon = "" ;
209
209
const statusBar = this . statusBar ;
210
210
switch ( status . health ) {
211
211
case "ok" :
212
- statusBar . tooltip = status . message ?? "Ready" ;
213
- statusBar . command = undefined ;
212
+ statusBar . tooltip = ( status . message ?? "Ready" ) + "Click to stop. ";
213
+ statusBar . command = "rust-analyzer.stopServer" ;
214
214
statusBar . color = undefined ;
215
215
statusBar . backgroundColor = undefined ;
216
216
break ;
@@ -234,6 +234,13 @@ export class Ctx {
234
234
statusBar . backgroundColor = new vscode . ThemeColor ( "statusBarItem.errorBackground" ) ;
235
235
icon = "$(error) " ;
236
236
break ;
237
+ case "stopped" :
238
+ statusBar . tooltip = "Server is stopped. Click to start." ;
239
+ statusBar . command = "rust-analyzer.startServer" ;
240
+ statusBar . color = undefined ;
241
+ statusBar . backgroundColor = undefined ;
242
+ statusBar . text = `$(stop-circle) rust-analyzer` ;
243
+ return ;
237
244
}
238
245
if ( ! status . quiescent ) icon = "$(sync~spin) " ;
239
246
statusBar . text = `${ icon } rust-analyzer` ;
Original file line number Diff line number Diff line change @@ -120,9 +120,7 @@ function createCommands(): Record<string, CommandFactory> {
120
120
// FIXME: We should re-use the client, that is ctx.deactivate() if none of the configs have changed
121
121
await ctx . stop ( ) ;
122
122
ctx . setServerStatus ( {
123
- health : "ok" ,
124
- quiescent : true ,
125
- message : "server is not running" ,
123
+ health : "stopped" ,
126
124
} ) ;
127
125
} ,
128
126
} ,
You can’t perform that action at this time.
0 commit comments