mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add cargo-watch.check-arguments
This commit is contained in:
parent
ee05eafe6c
commit
02e450f354
6 changed files with 139 additions and 74 deletions
|
@ -8,16 +8,21 @@ export type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled';
|
|||
export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose';
|
||||
|
||||
export interface CargoWatchOptions {
|
||||
enableOnStartup: CargoWatchStartupOptions,
|
||||
trace: CargoWatchTraceOptions,
|
||||
};
|
||||
enableOnStartup: CargoWatchStartupOptions;
|
||||
checkArguments: string;
|
||||
trace: CargoWatchTraceOptions;
|
||||
}
|
||||
|
||||
export class Config {
|
||||
public highlightingOn = true;
|
||||
public enableEnhancedTyping = true;
|
||||
public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
|
||||
public showWorkspaceLoadedNotification = true;
|
||||
public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off' };
|
||||
public cargoWatchOptions: CargoWatchOptions = {
|
||||
enableOnStartup: 'ask',
|
||||
trace: 'off',
|
||||
checkArguments: ''
|
||||
};
|
||||
|
||||
private prevEnhancedTyping: null | boolean = null;
|
||||
|
||||
|
@ -79,17 +84,23 @@ export class Config {
|
|||
}
|
||||
|
||||
if (config.has('enableCargoWatchOnStartup')) {
|
||||
this.cargoWatchOptions.enableOnStartup =
|
||||
config.get<CargoWatchStartupOptions>(
|
||||
'enableCargoWatchOnStartup',
|
||||
'ask'
|
||||
);
|
||||
this.cargoWatchOptions.trace =
|
||||
config.get<CargoWatchTraceOptions>(
|
||||
'trace.cargo-watch',
|
||||
'off'
|
||||
);
|
||||
this.cargoWatchOptions.enableOnStartup = config.get<
|
||||
CargoWatchStartupOptions
|
||||
>('enableCargoWatchOnStartup', 'ask');
|
||||
}
|
||||
|
||||
if (config.has('trace.cargo-watch')) {
|
||||
this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>(
|
||||
'trace.cargo-watch',
|
||||
'off'
|
||||
);
|
||||
}
|
||||
|
||||
if (config.has('cargo-watch.check-arguments')) {
|
||||
this.cargoWatchOptions.checkArguments = config.get<string>(
|
||||
'cargo-watch.check-arguments',
|
||||
''
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue