File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1115
1115
" Search in current workspace and dependencies."
1116
1116
]
1117
1117
},
1118
+ "rust-analyzer.restartServerOnConfigChange" : {
1119
+ "markdownDescription" : " Whether to restart the server automatically when certain settings that require a restart are changed." ,
1120
+ "default" : false ,
1121
+ "type" : " boolean"
1122
+ },
1118
1123
"$generated-end" : {}
1119
1124
}
1120
1125
},
Original file line number Diff line number Diff line change @@ -60,7 +60,18 @@ export class Config {
60
60
61
61
if ( ! requiresReloadOpt ) return ;
62
62
63
- await vscode . commands . executeCommand ( "rust-analyzer.reload" ) ;
63
+ if ( this . restartServerOnConfigChange ) {
64
+ await vscode . commands . executeCommand ( "rust-analyzer.reload" ) ;
65
+ } else {
66
+ const userResponse = await vscode . window . showInformationMessage (
67
+ `Changing "${ requiresReloadOpt } " requires a reload` ,
68
+ "Reload now"
69
+ ) ;
70
+
71
+ if ( userResponse === "Reload now" ) {
72
+ await vscode . commands . executeCommand ( "rust-analyzer.reload" ) ;
73
+ }
74
+ }
64
75
}
65
76
66
77
// We don't do runtime config validation here for simplicity. More on stackoverflow:
@@ -112,6 +123,10 @@ export class Config {
112
123
return this . get < RunnableEnvCfg > ( "runnableEnv" ) ;
113
124
}
114
125
126
+ get restartServerOnConfigChange ( ) {
127
+ return this . get < boolean > ( "restartServerOnConfigChange" ) ;
128
+ }
129
+
115
130
get debug ( ) {
116
131
let sourceFileMap = this . get < Record < string , string > | "auto" > ( "debug.sourceFileMap" ) ;
117
132
if ( sourceFileMap !== "auto" ) {
You can’t perform that action at this time.
0 commit comments