@@ -94,6 +94,7 @@ export class Ctx {
9494 private unlinkedFiles : vscode . Uri [ ] ;
9595 private _dependencies : RustDependenciesProvider | undefined ;
9696 private _treeView : vscode . TreeView < Dependency | DependencyFile | DependencyId > | undefined ;
97+ private lastStatus : ServerStatusParams | { health : "stopped" } = { health : "stopped" } ;
9798
9899 get client ( ) {
99100 return this . _client ;
@@ -404,7 +405,15 @@ export class Ctx {
404405 }
405406
406407 setServerStatus ( status : ServerStatusParams | { health : "stopped" } ) {
408+ this . lastStatus = status ;
409+ this . updateStatusBarItem ( ) ;
410+ }
411+ refreshServerStatus ( ) {
412+ this . updateStatusBarItem ( ) ;
413+ }
414+ private updateStatusBarItem ( ) {
407415 let icon = "" ;
416+ const status = this . lastStatus ;
408417 const statusBar = this . statusBar ;
409418 statusBar . show ( ) ;
410419 statusBar . tooltip = new vscode . MarkdownString ( "" , true ) ;
@@ -447,13 +456,18 @@ export class Ctx {
447456 "statusBarItem.warningBackground" ,
448457 ) ;
449458 statusBar . command = "rust-analyzer.startServer" ;
450- statusBar . text = ` $(stop-circle) rust-analyzer` ;
459+ statusBar . text = " $(stop-circle) rust-analyzer" ;
451460 return ;
452461 }
453462 if ( statusBar . tooltip . value ) {
454463 statusBar . tooltip . appendMarkdown ( "\n\n---\n\n" ) ;
455464 }
456- statusBar . tooltip . appendMarkdown ( "\n\n[Open logs](command:rust-analyzer.openLogs)" ) ;
465+ statusBar . tooltip . appendMarkdown ( "\n\n[Open Logs](command:rust-analyzer.openLogs)" ) ;
466+ statusBar . tooltip . appendMarkdown (
467+ `\n\n[${
468+ this . config . checkOnSave ? "Disable" : "Enable"
469+ } Check on Save](command:rust-analyzer.toggleCheckOnSave)`,
470+ ) ;
457471 statusBar . tooltip . appendMarkdown (
458472 "\n\n[Reload Workspace](command:rust-analyzer.reloadWorkspace)" ,
459473 ) ;
0 commit comments