mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Guard auto cargo watch behind a config option
This commit is contained in:
parent
60cac29964
commit
7c2595c268
3 changed files with 17 additions and 0 deletions
|
@ -168,6 +168,11 @@
|
|||
"default": "ra_lsp_server",
|
||||
"description": "Path to ra_lsp_server executable"
|
||||
},
|
||||
"rust-analyzer.enableCargoWatchOnStartup": {
|
||||
"type": "boolean",
|
||||
"default": "true",
|
||||
"description": "When enabled, ask the user whether to run `cargo watch` on startup"
|
||||
},
|
||||
"rust-analyzer.trace.server": {
|
||||
"type": "string",
|
||||
"scope": "window",
|
||||
|
|
|
@ -153,6 +153,10 @@ export const autoCargoWatchTask: vscode.Task = {
|
|||
* that, when accepted, allow us to `cargo install cargo-watch` and then run it.
|
||||
*/
|
||||
export async function interactivelyStartCargoWatch() {
|
||||
if (!Server.config.enableCargoWatchOnStartup) {
|
||||
return;
|
||||
}
|
||||
|
||||
const execAsync = util.promisify(exec);
|
||||
|
||||
const watch = await vscode.window.showInformationMessage(
|
||||
|
|
|
@ -9,6 +9,7 @@ export class Config {
|
|||
public enableEnhancedTyping = true;
|
||||
public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
|
||||
public showWorkspaceLoadedNotification = true;
|
||||
public enableCargoWatchOnStartup = true;
|
||||
|
||||
private prevEnhancedTyping: null | boolean = null;
|
||||
|
||||
|
@ -68,5 +69,12 @@ export class Config {
|
|||
this.raLspServerPath =
|
||||
RA_LSP_DEBUG || (config.get('raLspServerPath') as string);
|
||||
}
|
||||
|
||||
if (config.has('enableCargoWatchOnStartup')) {
|
||||
this.enableCargoWatchOnStartup = config.get<boolean>(
|
||||
'enableCargoWatchOnStartup',
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue