Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Dec 5, 2017
1 parent a2df24b commit 3854200
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log (vs-deploy)

## 12.0.3 (December 5th, 2017; bugfixes)

* bugfixes

## 12.0.2 (December 1st, 2017; bugfixes)

* bugfixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 21 additions & 7 deletions src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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)) || <any>{};
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}
Expand Down

0 comments on commit 3854200

Please sign in to comment.