Bugfix/atr 972 dev fix disappearing coloring#674
Open
SENya1990 wants to merge 15 commits into
Open
Conversation
…r instead of an injection into an exposed field
…lock during the entire workspace provider creation event
…der, moved initialization to the tagger provider constructor and do it only once without any flag checking, simplified the code, made maps of classification types read only
…he notification of the text document disposal in the base tagger
…er and remove the IDisposable interface
…s over BQL operators and simplify the coloring tagger provider. This code was required for the regex coloring that was already removed.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts VSIX colorizer/outlining tagger lifetime management to avoid premature disposal (notably from temporary VS text views) by tying cleanup to the underlying ITextDocument disposal, and refactors the colorizer tagger provider initialization to be constructor-based.
Changes:
- Introduces
TextDocumentDisposedNotificationto detect when theITextDocumentassociated with a tagger’sITextBufferis disposed. - Removes
IDisposable-based tagger cleanup in favor of cleanup triggered on text document disposal (viaPXTaggerBase). - Refactors
PXColorizerTaggerProviderto constructor-initialize classification maps and simplifies Roslyn workspace provider creation/synchronization.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Acuminator/Acuminator.Vsix/Coloriser/TextDocumentDisposedNotification.cs | New helper to signal text document disposal for a given buffer. |
| src/Acuminator/Acuminator.Vsix/Coloriser/Roslyn/RoslynWorkspaceProvider.cs | Refactors workspace provider construction into a factory with external sync lock. |
| src/Acuminator/Acuminator.Vsix/Coloriser/PXRoslynColorizerTagger.cs | Removes IDisposable path and performs cleanup on document disposal; updates workspace provider creation. |
| src/Acuminator/Acuminator.Vsix/Coloriser/PXColorizerTaggerProvider.cs | Moves MEF initialization to importing constructor; simplifies classification initialization and tagger creation. |
| src/Acuminator/Acuminator.Vsix/Coloriser/Outlining/PXOutliningTaggerProvider.cs | Injects ITextDocumentFactoryService and passes it into outlining tagger for document-lifetime cleanup. |
| src/Acuminator/Acuminator.Vsix/Coloriser/Outlining/PXOutliningTagger.cs | Switches from Dispose() override to cleanup on document disposal. |
| src/Acuminator/Acuminator.Vsix/Coloriser/Base/PXTaggerBase.cs | Centralizes tagger cleanup on ITextDocument disposal and removes IDisposable from the base class. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…onent not being thread safe
…e BackgoundTagging.Dispose call
9f2a1bd to
514b13d
Compare
514b13d to
1832f1b
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes Overview
TextDocumentDisposedNotificationcomponent to subscribe to the disposal of the text document for which tagger was createdIDisposableinterface from coloring and outlining taggers, added the use of the new mechanism to dispose taggers only on the text document's disposal to avoid calls toDisposefor the cached tagger instance from the temp VS text views.CreateTaggermethod to the constructor, simplified code.