Skip to content
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

Feature/detect settings changes (Fixes #56) #57

Merged
merged 15 commits into from
Nov 4, 2019

Conversation

TheSench
Copy link
Collaborator

@TheSench TheSench commented Oct 26, 2019

Description

This PR introduces the following changes:

  1. It listens for settings changes, and triggers a reload of the gremlins configuration if it detects any.
  2. It adds disposing of Disposable resources during deactivation.
  3. Loaded configuration is moved from function scope to module-wide scope so that it can be accessed during extension deactivation.

Fixes #56

Motivation and Context

The current implementation does not update when configuration settings are changed. Any changes require a reload of VSCode before they take effect. This change updates the extension to listen for settings changes and then resets its in-memory configuration.

Additionally, during testing, it was discovered that several Disposable items were not being disposed of. This normally doesn't cause any issues, as the extension is usually only deactivated when VSCode is closed. When working with setting changes though, this runs into issues with the decorations - recreating decorations without disposing of the old ones causes the decoration changes to not actually show up (e.g. changing the gremlin icon size).

How Has This Been Tested?

This has been tested via unit tests and manual testing.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Owner

@nhoizey nhoizey left a comment

Choose a reason for hiding this comment

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

This PR looks great.

I just made 2 comments to understand what/why you did it.

extension.js Show resolved Hide resolved
extension.test.js Show resolved Hide resolved
extension.js Show resolved Hide resolved
extension.test.js Show resolved Hide resolved
extension.test.js Show resolved Hide resolved
@nhoizey nhoizey merged commit d21d95e into nhoizey:master Nov 4, 2019
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.

[Feature request] Configuration Changes Not Applied Until Restart
2 participants