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

Remove the 'Compilation Available' tagger event source #72384

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ public Tagger(
_subjectBuffer = subjectBuffer;
_globalOptions = globalOptions;

// Note: because we use frozen-partial documents for semantic classification, we may end up with incomplete
Copy link
Contributor

Choose a reason for hiding this comment

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

I was surprised that a search for "frozen" didn't hit in this document. Just wanted to make sure we are not missing a WithFrozenPartialSemantics call here.

Copy link
Member Author

Choose a reason for hiding this comment

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

it happens in the classification service itself. that said, you raise a good point that it's odd for it to happen there. i will look into having the underlying helpers not do that, and instead bring to the feature level.

// semantics (esp. during solution load). Because of this, we also register to hear when the full
// compilation is available so that reclassify and bring ourselves up to date.
_eventSource = new CompilationAvailableTaggerEventSource(
subjectBuffer,
asyncListener,
_eventSource = TaggerEventSources.Compose(
TaggerEventSources.OnWorkspaceChanged(subjectBuffer, asyncListener),
TaggerEventSources.OnDocumentActiveContextChanged(subjectBuffer));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,7 @@ protected sealed override ITaggerEventSource CreateEventSource(ITextView textVie

// Note: we don't listen for OnTextChanged. They'll get reported by the ViewSpan changing and also the
// SemanticChange notification.
//
// Note: because we use frozen-partial documents for semantic classification, we may end up with incomplete
CyrusNajmabadi marked this conversation as resolved.
Show resolved Hide resolved
// semantics (esp. during solution load). Because of this, we also register to hear when the full
// compilation is available so that reclassify and bring ourselves up to date.
return new CompilationAvailableTaggerEventSource(
subjectBuffer,
AsyncListener,
return TaggerEventSources.Compose(
TaggerEventSources.OnViewSpanChanged(ThreadingContext, textView),
TaggerEventSources.OnWorkspaceChanged(subjectBuffer, AsyncListener),
TaggerEventSources.OnDocumentActiveContextChanged(subjectBuffer),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ public NavigationBarController(

// Use 'compilation available' as that may produce different results from the initial 'frozen partial'
// snapshot we use.
_eventSource = new CompilationAvailableTaggerEventSource(
subjectBuffer,
asyncListener,
_eventSource = TaggerEventSources.Compose(
// Any time an edit happens, recompute as the nav bar items may have changed.
TaggerEventSources.OnTextChanged(subjectBuffer),
// Switching what is the active context may change the nav bar contents.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ protected override bool CanCreateTagger(ITextView textView, ITextBuffer buffer)

protected override ITaggerEventSource CreateEventSource(ITextView textView, ITextBuffer subjectBuffer)
{
// Because we use frozen-partial documents for semantic classification, we may end up with incomplete
// semantics (esp. during solution load). Because of this, we also register to hear when the full
// compilation is available so that reclassify and bring ourselves up to date.
// Note: Also generate tags when InheritanceMarginOptions.InheritanceMarginCombinedWithIndicatorMargin is changed,
// because we want to refresh the glyphs in indicator margin.
return new CompilationAvailableTaggerEventSource(
subjectBuffer,
AsyncListener,
return TaggerEventSources.Compose(
CyrusNajmabadi marked this conversation as resolved.
Show resolved Hide resolved
TaggerEventSources.OnWorkspaceChanged(subjectBuffer, AsyncListener),
TaggerEventSources.OnViewSpanChanged(ThreadingContext, textView),
TaggerEventSources.OnDocumentActiveContextChanged(subjectBuffer),
Expand Down Expand Up @@ -103,7 +98,6 @@ protected override async Task ProduceTagsAsync(

// Use FrozenSemantics Version of document to get the semantics ready, therefore we could have faster
// response. (Since the full load might take a long time)
// We also subscribe to CompilationAvailableTaggerEventSource, so this will finally reach the correct state.
document = document.WithFrozenPartialSemantics(cancellationToken);

var spanToSearch = spanToTag.SnapshotSpan.Span.ToTextSpan();
Expand Down
Loading