@@ -282,41 +282,51 @@ export class Ctx {
282282 setServerStatus ( status : ServerStatusParams | { health : "stopped" } ) {
283283 let icon = "" ;
284284 const statusBar = this . statusBar ;
285+ statusBar . tooltip = new vscode . MarkdownString ( "" , true ) ;
286+ statusBar . tooltip . isTrusted = true ;
285287 switch ( status . health ) {
286288 case "ok" :
287- statusBar . tooltip = ( status . message ?? "Ready" ) + "\nClick to stop server." ;
288- statusBar . command = "rust-analyzer.stopServer" ;
289+ statusBar . tooltip . appendText ( status . message ?? "Ready" ) ;
289290 statusBar . color = undefined ;
290291 statusBar . backgroundColor = undefined ;
291292 break ;
292293 case "warning" :
293- statusBar . tooltip =
294- ( status . message ? status . message + "\n" : "" ) + "Click to reload." ;
295-
296- statusBar . command = "rust-analyzer.reloadWorkspace" ;
294+ if ( status . message ) {
295+ statusBar . tooltip . appendText ( status . message ) ;
296+ }
297297 statusBar . color = new vscode . ThemeColor ( "statusBarItem.warningForeground" ) ;
298298 statusBar . backgroundColor = new vscode . ThemeColor (
299299 "statusBarItem.warningBackground"
300300 ) ;
301301 icon = "$(warning) " ;
302302 break ;
303303 case "error" :
304- statusBar . tooltip =
305- ( status . message ? status . message + "\n" : "" ) + "Click to reload." ;
306-
307- statusBar . command = "rust-analyzer.reloadWorkspace" ;
304+ if ( status . message ) {
305+ statusBar . tooltip . appendText ( status . message ) ;
306+ }
308307 statusBar . color = new vscode . ThemeColor ( "statusBarItem.errorForeground" ) ;
309308 statusBar . backgroundColor = new vscode . ThemeColor ( "statusBarItem.errorBackground" ) ;
310309 icon = "$(error) " ;
311310 break ;
312311 case "stopped" :
313- statusBar . tooltip = "Server is stopped.\nClick to start." ;
314- statusBar . command = "rust-analyzer.startServer" ;
312+ statusBar . tooltip . appendText ( "Server is stopped" ) ;
313+ statusBar . tooltip . appendMarkdown (
314+ "\n\n[Start server](command:rust-analyzer.startServer)"
315+ ) ;
315316 statusBar . color = undefined ;
316317 statusBar . backgroundColor = undefined ;
317318 statusBar . text = `$(stop-circle) rust-analyzer` ;
318319 return ;
319320 }
321+ if ( statusBar . tooltip . value ) {
322+ statusBar . tooltip . appendText ( "\n\n" ) ;
323+ }
324+ statusBar . tooltip . appendMarkdown ( "[Stop server](command:rust-analyzer.stopServer)" ) ;
325+ statusBar . tooltip . appendMarkdown (
326+ "\n\n[Reload Workspace](command:rust-analyzer.reloadWorkspace)"
327+ ) ;
328+ statusBar . tooltip . appendMarkdown ( "\n\n[Restart server](command:rust-analyzer.startServer)" ) ;
329+ statusBar . tooltip . appendMarkdown ( "\n\n[Open logs](command:rust-analyzer.openLogs)" ) ;
320330 if ( ! status . quiescent ) icon = "$(sync~spin) " ;
321331 statusBar . text = `${ icon } rust-analyzer` ;
322332 }
0 commit comments