diff options
author | memoryruins <[email protected]> | 2020-01-15 01:52:48 +0000 |
---|---|---|
committer | memoryruins <[email protected]> | 2020-01-15 01:52:48 +0000 |
commit | edb820c3293142b034a20f4502192080fe74072a (patch) | |
tree | a0156ea781564c9038f432be8f5dffe95a453632 | |
parent | 754d9d1a0c3551b01126e8e88d1fc3ff45ca695d (diff) |
Display vscode message after changing cargo-watch options
-rw-r--r-- | editors/code/src/config.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index ec2790b63..c6d5fc4af 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -42,6 +42,7 @@ export class Config { | |||
42 | 42 | ||
43 | private prevEnhancedTyping: null | boolean = null; | 43 | private prevEnhancedTyping: null | boolean = null; |
44 | private prevCargoFeatures: null | CargoFeatures = null; | 44 | private prevCargoFeatures: null | CargoFeatures = null; |
45 | private prevCargoWatchOptions: null | CargoWatchOptions = null; | ||
45 | 46 | ||
46 | constructor(ctx: vscode.ExtensionContext) { | 47 | constructor(ctx: vscode.ExtensionContext) { |
47 | vscode.workspace.onDidChangeConfiguration(_ => this.refresh(), ctx.subscriptions); | 48 | vscode.workspace.onDidChangeConfiguration(_ => this.refresh(), ctx.subscriptions); |
@@ -173,6 +174,24 @@ export class Config { | |||
173 | requireReloadMessage = 'Changing cargo features requires a reload'; | 174 | requireReloadMessage = 'Changing cargo features requires a reload'; |
174 | } | 175 | } |
175 | this.prevCargoFeatures = { ...this.cargoFeatures }; | 176 | this.prevCargoFeatures = { ...this.cargoFeatures }; |
177 | |||
178 | if ( | ||
179 | this.prevCargoWatchOptions !== null && | ||
180 | (this.cargoWatchOptions.enable !== | ||
181 | this.prevCargoWatchOptions.enable || | ||
182 | this.cargoWatchOptions.command !== | ||
183 | this.prevCargoWatchOptions.command || | ||
184 | this.cargoWatchOptions.allTargets !== | ||
185 | this.prevCargoWatchOptions.allTargets || | ||
186 | this.cargoWatchOptions.arguments.length !== | ||
187 | this.prevCargoWatchOptions.arguments.length || | ||
188 | this.cargoWatchOptions.arguments.some( | ||
189 | (v, i) => v !== this.prevCargoWatchOptions!.arguments[i], | ||
190 | )) | ||
191 | ) { | ||
192 | requireReloadMessage = 'Changing cargo-watch options requires a reload'; | ||
193 | } | ||
194 | this.prevCargoWatchOptions = { ...this.cargoWatchOptions }; | ||
176 | 195 | ||
177 | if (requireReloadMessage !== null) { | 196 | if (requireReloadMessage !== null) { |
178 | const reloadAction = 'Reload now'; | 197 | const reloadAction = 'Reload now'; |