From edb820c3293142b034a20f4502192080fe74072a Mon Sep 17 00:00:00 2001 From: memoryruins Date: Tue, 14 Jan 2020 20:52:48 -0500 Subject: [PATCH] Display vscode message after changing cargo-watch options --- editors/code/src/config.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index ec2790b63c1..c6d5fc4af33 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -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';