-
Notifications
You must be signed in to change notification settings - Fork 15
Bugfix/atr 972 dev fix disappearing coloring #674
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
Open
SENya1990
wants to merge
15
commits into
dev
Choose a base branch
from
bugfix/ATR-972-dev-fix-disappearing-coloring
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c89f6de
ATR-972: reworked MEF imports to work through an importing constructo…
SENya1990 2ae17f1
ATR-972: improved synchronization in the constructor to use the same …
SENya1990 3e79a96
ATR-972: added import of ITextDocumentFactoryService via MEF to the t…
SENya1990 9a52bc2
ATR-972: refactoring + optimization - reworked colorizer tagger provi…
SENya1990 2f5ab6a
ATR-972: implemented notification for the disposal of the current doc…
SENya1990 1a22e42
ATR-972: replaced the DIspose method and IDisposable interface with t…
SENya1990 5d49238
ATR-972: integrated new notification mechanism into the outlining tagger
SENya1990 fc1639f
ATR-972: integrated new notification mechanism into the coloring tagg…
SENya1990 45c7a21
ATR-972: removed the code that increases the priority of code comment…
SENya1990 86c2c78
ATR-972: refactoring - renaming on Copilot suggestion
SENya1990 6b87921
ATR-972: minor cleanups based on AI remarks
SENya1990 eae2ecf
ATR-972: added the dispose call to the workspace provider under lock …
SENya1990 f2382cd
ATR-972: added comment about text document disposed notification comp…
SENya1990 d7dbdec
ATR-972: Copilot suggestion - always cancel tagging on the call to th…
SENya1990 1832f1b
ATR-972: added safe CTS Cancel call in Dispose with logging of except…
SENya1990 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
41 changes: 23 additions & 18 deletions
41
src/Acuminator/Acuminator.Vsix/Coloriser/Outlining/PXOutliningTaggerProvider.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,41 @@ | ||
| #nullable enable | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel.Composition; | ||
| using System.Linq; | ||
|
|
||
|
SENya1990 marked this conversation as resolved.
|
||
| using Microsoft.VisualStudio.Shell; | ||
| using Microsoft.VisualStudio.Text; | ||
| using Microsoft.VisualStudio.Text.Classification; | ||
| using Microsoft.VisualStudio.Text.Editor; | ||
| using Microsoft.VisualStudio.Text.Tagging; | ||
| using Microsoft.VisualStudio.Utilities; | ||
|
|
||
| namespace Acuminator.Vsix.Coloriser | ||
| namespace Acuminator.Vsix.Coloriser; | ||
|
|
||
| [ContentType("CSharp")] | ||
| [TagType(typeof(IOutliningRegionTag))] | ||
| [TextViewRole(PredefinedTextViewRoles.Document)] | ||
| [Export(typeof(ITaggerProvider))] | ||
| public class PXOutliningTaggerProvider : ITaggerProvider | ||
| { | ||
| [ContentType("CSharp")] | ||
| [TagType(typeof(IOutliningRegionTag))] | ||
| [TextViewRole(PredefinedTextViewRoles.Document)] | ||
| [Export(typeof(ITaggerProvider))] | ||
| public class PXOutliningTaggerProvider : ITaggerProvider | ||
| private readonly ITextDocumentFactoryService _textDocumentFactory; | ||
|
|
||
| [ImportingConstructor] | ||
| public PXOutliningTaggerProvider(ITextDocumentFactoryService textDocumentFactory) | ||
| { | ||
| public ITagger<T>? CreateTagger<T>(ITextBuffer buffer) where T : ITag | ||
| { | ||
| if (buffer == null || !ThreadHelper.CheckAccess()) | ||
| return null; | ||
| _textDocumentFactory = textDocumentFactory; | ||
| } | ||
|
|
||
| public ITagger<T>? CreateTagger<T>(ITextBuffer buffer) where T : ITag | ||
| { | ||
| if (buffer == null || !ThreadHelper.CheckAccess()) | ||
| return null; | ||
|
|
||
| PXOutliningTagger outliningTagger = buffer.Properties.GetOrCreateSingletonProperty(() => | ||
| { | ||
| return new PXOutliningTagger(buffer, subscribeToSettingsChanges: true, useCacheChecking: true); | ||
| }); | ||
| PXOutliningTagger outliningTagger = buffer.Properties.GetOrCreateSingletonProperty(typeof(PXOutliningTagger), () => | ||
| { | ||
| return new PXOutliningTagger(buffer, _textDocumentFactory, subscribeToSettingsChanges: true, useCacheChecking: true); | ||
| }); | ||
|
SENya1990 marked this conversation as resolved.
|
||
|
|
||
| return outliningTagger as ITagger<T>; | ||
| } | ||
| return outliningTagger as ITagger<T>; | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.