mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Display vscode message after changing cargo-watch options
This commit is contained in:
parent
754d9d1a0c
commit
edb820c329
1 changed files with 19 additions and 0 deletions
|
@ -42,6 +42,7 @@ export class Config {
|
|||
|
||||
private prevEnhancedTyping: null | boolean = null;
|
||||
private prevCargoFeatures: null | CargoFeatures = null;
|
||||
private prevCargoWatchOptions: null | CargoWatchOptions = null;
|
||||
|
||||
constructor(ctx: vscode.ExtensionContext) {
|
||||
vscode.workspace.onDidChangeConfiguration(_ => this.refresh(), ctx.subscriptions);
|
||||
|
@ -173,6 +174,24 @@ export class Config {
|
|||
requireReloadMessage = 'Changing cargo features requires a reload';
|
||||
}
|
||||
this.prevCargoFeatures = { ...this.cargoFeatures };
|
||||
|
||||
if (
|
||||
this.prevCargoWatchOptions !== null &&
|
||||
(this.cargoWatchOptions.enable !==
|
||||
this.prevCargoWatchOptions.enable ||
|
||||
this.cargoWatchOptions.command !==
|
||||
this.prevCargoWatchOptions.command ||
|
||||
this.cargoWatchOptions.allTargets !==
|
||||
this.prevCargoWatchOptions.allTargets ||
|
||||
this.cargoWatchOptions.arguments.length !==
|
||||
this.prevCargoWatchOptions.arguments.length ||
|
||||
this.cargoWatchOptions.arguments.some(
|
||||
(v, i) => v !== this.prevCargoWatchOptions!.arguments[i],
|
||||
))
|
||||
) {
|
||||
requireReloadMessage = 'Changing cargo-watch options requires a reload';
|
||||
}
|
||||
this.prevCargoWatchOptions = { ...this.cargoWatchOptions };
|
||||
|
||||
if (requireReloadMessage !== null) {
|
||||
const reloadAction = 'Reload now';
|
||||
|
|
Loading…
Reference in a new issue