This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Draft
Conversation
added 6 commits
March 2, 2019 21:53
Highlights do not go away after deactivating
Contributor
Author
|
@Aerijo I don't think the |
It doesn't really hurt having it in there, but I think you're right that it's not actually necessary since on |
added 2 commits
March 5, 2019 19:19
Contributor
Author
|
Well, this is complicated by the use of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Description of the Change
bracket-matcher does not deactivate cleanly - that is, it continues to match brackets and provide bracket autocompletion even after it is deactivated. This is because none of its subscriptions are disposed upon deactivation.
We now keep track of the
observeTextEditorsandeditor.onDidDestroysubscriptions and dispose of them so that bracket-matcher does not continue matching brackets whenever a new editor is opened. Furthermore, upon deactivation/editor destruction, we now dispose of all the subscriptions that we create per-editor (this additionally means that each class no longer has to individually subscribe to theeditor.onDidDestroy).Alternate Designs
Coming later
Benefits
Deactivation will work.
Possible Drawbacks
None.
Applicable Issues
Fixes #156
Todo:
watchedEditors.hascheck inobserveTextEditorsnecessary? Seems to me like we're disposing of everything ineditor.onDidDestroy, so we shouldn't need ahascheck when a new editor is added._.adviseBeforecontinues to function after deactivation, meaning brackets are still auto-inserted.