mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add config for cargo-watch trace
This commit is contained in:
parent
b84d0fc1a3
commit
ee05eafe6c
5 changed files with 67 additions and 15 deletions
|
@ -4,14 +4,20 @@ import { Server } from './server';
|
|||
|
||||
const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
|
||||
|
||||
export type CargoWatchOptions = 'ask' | 'enabled' | 'disabled';
|
||||
export type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled';
|
||||
export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose';
|
||||
|
||||
export interface CargoWatchOptions {
|
||||
enableOnStartup: CargoWatchStartupOptions,
|
||||
trace: CargoWatchTraceOptions,
|
||||
};
|
||||
|
||||
export class Config {
|
||||
public highlightingOn = true;
|
||||
public enableEnhancedTyping = true;
|
||||
public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
|
||||
public showWorkspaceLoadedNotification = true;
|
||||
public enableCargoWatchOnStartup: CargoWatchOptions = 'ask';
|
||||
public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off' };
|
||||
|
||||
private prevEnhancedTyping: null | boolean = null;
|
||||
|
||||
|
@ -73,10 +79,17 @@ export class Config {
|
|||
}
|
||||
|
||||
if (config.has('enableCargoWatchOnStartup')) {
|
||||
this.enableCargoWatchOnStartup = config.get<CargoWatchOptions>(
|
||||
'enableCargoWatchOnStartup',
|
||||
'ask'
|
||||
);
|
||||
this.cargoWatchOptions.enableOnStartup =
|
||||
config.get<CargoWatchStartupOptions>(
|
||||
'enableCargoWatchOnStartup',
|
||||
'ask'
|
||||
);
|
||||
this.cargoWatchOptions.trace =
|
||||
config.get<CargoWatchTraceOptions>(
|
||||
'trace.cargo-watch',
|
||||
'off'
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue