File tree 3 files changed +22
-1
lines changed
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 371
371
],
372
372
"markdownDescription" : " Problem matchers to use for `rust-analyzer.run` command, eg `[\" $rustc\" , \" $rust-panic\" ]`."
373
373
},
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
+ },
374
387
"rust-analyzer.server.path" : {
375
388
"type" : [
376
389
" null" ,
Original file line number Diff line number Diff line change @@ -329,6 +329,10 @@ export class Config {
329
329
get showDependenciesExplorer ( ) {
330
330
return this . get < boolean > ( "showDependenciesExplorer" ) ;
331
331
}
332
+
333
+ get statusBarClickAction ( ) {
334
+ return this . get < string > ( "statusBar.clickAction" ) ;
335
+ }
332
336
}
333
337
334
338
// 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 {
400
400
statusBar . tooltip . appendText ( status . message ?? "Ready" ) ;
401
401
statusBar . color = undefined ;
402
402
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
+ }
404
408
this . dependencies ?. refresh ( ) ;
405
409
break ;
406
410
case "warning" :
You can’t perform that action at this time.
0 commit comments