mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Change enableCargoWatchOnStartup to have three states
This fixes #1005. Defaults to `ask` which prompts users each time whether to start `cargo watch` or not. `enabled` always starts `cargo watch` and `disabled` does not.
This commit is contained in:
parent
aa0cc0c609
commit
5c3e9c716e
3 changed files with 31 additions and 16 deletions
|
@ -4,12 +4,14 @@ import { Server } from './server';
|
|||
|
||||
const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
|
||||
|
||||
export type CargoWatchOptions = 'ask' | 'enabled' | 'disabled';
|
||||
|
||||
export class Config {
|
||||
public highlightingOn = true;
|
||||
public enableEnhancedTyping = true;
|
||||
public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
|
||||
public showWorkspaceLoadedNotification = true;
|
||||
public enableCargoWatchOnStartup = true;
|
||||
public enableCargoWatchOnStartup: CargoWatchOptions = 'ask';
|
||||
|
||||
private prevEnhancedTyping: null | boolean = null;
|
||||
|
||||
|
@ -71,9 +73,9 @@ export class Config {
|
|||
}
|
||||
|
||||
if (config.has('enableCargoWatchOnStartup')) {
|
||||
this.enableCargoWatchOnStartup = config.get<boolean>(
|
||||
this.enableCargoWatchOnStartup = config.get<CargoWatchOptions>(
|
||||
'enableCargoWatchOnStartup',
|
||||
true
|
||||
'ask'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue