File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 371371 ],
372372 "markdownDescription" : " Problem matchers to use for `rust-analyzer.run` command, eg `[\" $rustc\" , \" $rust-panic\" ]`."
373373 },
374+ "rust-analyzer.statusBar.clickAction" : {
375+ "type" : " string" ,
376+ "enum" : [
377+ " stopServer" ,
378+ " openLogs"
379+ ],
380+ "enumDescriptions" : [
381+ " Stop Server" ,
382+ " Open Logs"
383+ ],
384+ "default" : " openLogs" ,
385+ "markdownDescription" : " Action to run when clicking the extension status bar item."
386+ },
374387 "rust-analyzer.server.path" : {
375388 "type" : [
376389 " null" ,
Original file line number Diff line number Diff line change @@ -329,6 +329,10 @@ export class Config {
329329 get showDependenciesExplorer ( ) {
330330 return this . get < boolean > ( "showDependenciesExplorer" ) ;
331331 }
332+
333+ get statusBarClickAction ( ) {
334+ return this . get < string > ( "statusBar.clickAction" ) ;
335+ }
332336}
333337
334338// the optional `cb?` parameter is meant to be used to add additional
Original file line number Diff line number Diff line change @@ -400,7 +400,11 @@ export class Ctx {
400400 statusBar . tooltip . appendText ( status . message ?? "Ready" ) ;
401401 statusBar . color = undefined ;
402402 statusBar . backgroundColor = undefined ;
403- statusBar . command = "rust-analyzer.openLogs" ;
403+ if ( this . config . statusBarClickAction === "stopServer" ) {
404+ statusBar . command = "rust-analyzer.stopServer" ;
405+ } else {
406+ statusBar . command = "rust-analyzer.openLogs" ;
407+ }
404408 this . dependencies ?. refresh ( ) ;
405409 break ;
406410 case "warning" :
You can’t perform that action at this time.
0 commit comments