Skip to content

Bugfix/atr 972 dev fix disappearing coloring#674

Open
SENya1990 wants to merge 15 commits into
devfrom
bugfix/ATR-972-dev-fix-disappearing-coloring
Open

Bugfix/atr 972 dev fix disappearing coloring#674
SENya1990 wants to merge 15 commits into
devfrom
bugfix/ATR-972-dev-fix-disappearing-coloring

Conversation

@SENya1990
Copy link
Copy Markdown
Collaborator

Changes Overview

  • Added new TextDocumentDisposedNotification component to subscribe to the disposal of the text document for which tagger was created
  • Removed IDisposable interface 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 to Dispose for the cached tagger instance from the temp VS text views.
  • Enhanced sync block in the colorizer tagger's constructor for the Roslyn workspace provider creation
  • Refactored the colorizing tagger provider:
    • Made MEF-injected services private readonly fields injected via injecting constructor MEF mechanism,
    • Moved initialization from the CreateTagger method to the constructor, simplified code.
    • Removed code that increases the priority of code comments since it was needed only for reg ex based coloring which was already removed. Greatly simplified code coloring.

SENya1990 added 9 commits June 5, 2026 13:46
…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
…s over BQL operators and simplify the coloring tagger provider. This code was required for the regex coloring that was already removed.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 TextDocumentDisposedNotification to detect when the ITextDocument associated with a tagger’s ITextBuffer is disposed.
  • Removes IDisposable-based tagger cleanup in favor of cleanup triggered on text document disposal (via PXTaggerBase).
  • Refactors PXColorizerTaggerProvider to 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.

Comment thread src/Acuminator/Acuminator.Vsix/Coloriser/TextDocumentDisposedNotification.cs Outdated
Comment thread src/Acuminator/Acuminator.Vsix/Coloriser/PXRoslynColorizerTagger.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

@SENya1990 SENya1990 force-pushed the bugfix/ATR-972-dev-fix-disappearing-coloring branch from 9f2a1bd to 514b13d Compare June 5, 2026 16:20
@SENya1990 SENya1990 requested a review from Copilot June 5, 2026 16:25
@SENya1990 SENya1990 force-pushed the bugfix/ATR-972-dev-fix-disappearing-coloring branch from 514b13d to 1832f1b Compare June 5, 2026 16:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread src/Acuminator/Acuminator.Vsix/Coloriser/AsyncTagging/BackgroundTagging.cs Outdated
@SENya1990 SENya1990 requested a review from dropsonic June 5, 2026 16:32
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