diff --git a/CHANGELOG.md b/CHANGELOG.md index fb75bed..e44fb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log (vs-deploy) +## 12.0.3 (December 5th, 2017; bugfixes) + +* bugfixes + ## 12.0.2 (December 1st, 2017; bugfixes) * bugfixes diff --git a/package.json b/package.json index 7b22d87..4decff5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vs-deploy", "displayName": "Deploy", "description": "Commands for deploying files of your workspace to a destination.", - "version": "12.0.2", + "version": "12.0.3", "publisher": "mkloubert", "engines": { "vscode": "^1.18.0" diff --git a/src/deploy.ts b/src/deploy.ts index e9b943d..a0db470 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -2365,6 +2365,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable { */ public onDidChangeActiveTextEditor(editor: vscode.TextEditor) { const ME = this; + const CFG = ME.config; const PREVIOUS_EDITOR = ME._currentTextEditor; ME._currentTextEditor = editor; @@ -2390,7 +2391,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable { if (newFolder) { deploy_workspace.setWorkspace(newFolder); - ME.onDidChangeConfiguration(); + ME.reloadConfiguration(); } } catch (e) { @@ -2399,7 +2400,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable { }; if (editor) { - if (deploy_helpers.toBooleanSafe( ME.config.autoSelectWorkspace )) { + if (CFG && deploy_helpers.toBooleanSafe( CFG.autoSelectWorkspace )) { const DOC = editor.document; if (DOC) { @@ -2465,7 +2466,11 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable { /** * Event after configuration changed. */ - public onDidChangeConfiguration() { + public onDidChangeConfiguration(e: vscode.ConfigurationChangeEvent) { + if (!e.affectsConfiguration('deploy', vscode.Uri.file(this.settingsFile))) { + return; + } + this.reloadConfiguration(); } @@ -4107,10 +4112,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable { }; try { - const SETTINGS_FILE = Path.join( - deploy_workspace.getRootPath(), - './.vscode/settings.json', - ); + const SETTINGS_FILE = ME.settingsFile; const LOADED_CFG: deploy_contracts.DeployConfiguration = vscode.workspace.getConfiguration('deploy', vscode.Uri.file(SETTINGS_FILE)) || {}; @@ -4780,6 +4782,18 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable { return deploy_values.replaceWithValues(this.getValues(), val); } + /** + * Gets the underlying settings file. + */ + public get settingsFile() { + return Path.resolve( + Path.join( + deploy_workspace.getRootPath(), + './.vscode/settings.json' + ) + ); + } + /** * Set ups the file system watcher. */ diff --git a/src/extension.ts b/src/extension.ts index 83e4679..8bdc8ad 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -233,7 +233,7 @@ export function activate(context: vscode.ExtensionContext) { const FOLDER = await deploy_workspace.selectWorkspace(); if (FOLDER) { await Promise.resolve( - deployer.onDidChangeConfiguration() + deployer.reloadConfiguration() ); } }