Skip to content

Commit

Permalink
Fixes issue that display incorrect interpreter briefly before updatin…
Browse files Browse the repository at this point in the history
…g it to the right value (#1054)

* 🐛 fire change event only when changes are detected
* 📝 change log
* 🔨 fix typos
* Fixes #981
  • Loading branch information
DonJayamanne authored Mar 15, 2018
1 parent 05ad30e commit 822cd7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/981.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes issue that display incorrect interpreter briefly before updating it to the right value.
8 changes: 4 additions & 4 deletions src/client/common/configSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
this.workspaceRoot = workspaceFolder ? workspaceFolder : vscode.Uri.file(__dirname);
this.disposables.push(vscode.workspace.onDidChangeConfiguration(() => {
this.initializeSettings();

// If workspace config changes, then we could have a cascading effect of on change events.
// Let's defer the change notification.
setTimeout(() => this.emit('change'), 1);
}));

this.initializeSettings();
Expand Down Expand Up @@ -292,10 +296,6 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
launchArgs: [],
activateEnvironment: true
};

// If workspace config changes, then we could have a cascading effect of on change events.
// Let's defer the change notification.
setTimeout(() => this.emit('change'), 1);
}

public get pythonPath(): string {
Expand Down

0 comments on commit 822cd7a

Please sign in to comment.