Skip to content

Refactor onDidChangeConfiguration handler in favor of listener pattern #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 26, 2019

Conversation

Vigilans
Copy link
Member

This PR

  • Refactor the onDidChangeConfiguration hanlder in favor oflistener(updatedConfig, oldConfig) pattern.
  • move the old logic into separate listeners
  • makes sure that when a listener gets called, it will receive the latest configuration from Settings.getSomeSetting.

src/settings.ts Outdated
@@ -16,23 +16,27 @@ export class Settings {
if (!e.affectsConfiguration("java.dependency")) {
return;
}
const oldConfig = this._dependencyConfig;
const updatedConfig = workspace.getConfiguration("java.dependency");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updatedConfig variable is not necessary.

@Vigilans Vigilans merged commit 5c4660a into master Nov 26, 2019
@Vigilans Vigilans deleted the vigilans/settings-listener branch November 26, 2019 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants