-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Remove the 'Compilation Available' tagger event source #72384
Conversation
private void OnUnderlyingSourceChanged(object? sender, TaggerEventArgs args) | ||
{ | ||
// First, notify anyone listening to us that something definitely changed. | ||
this.Changed?.Invoke(this, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the main problem is simply that we'd need those features to have a new concept (Which doesn't exist at all). Which is:
- use the compilation if available, but otherwise, use teh frozen partial one.
Note that the above is highly problematic as well as the features will often be working with a slightly changed doc, and thus are calling "get frozen partial snapshot with changes". In that world, we def do not want anything related to the real compilation as that involves computing generators.
This basically also involves the workspace having some sort of internal eventing model itself for these sorts of concepts. I'm very wary of that, esp. as it encourages more of a 'push' approach for these features.
My preference for now is simply saying: if you use frozen partial, you are opting into staleness against the snapshot you're currently operating on.
src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginTaggerProvider.cs
Show resolved
Hide resolved
@@ -48,12 +48,7 @@ private sealed class Tagger : IAccurateTagger<IClassificationTag>, IDisposable | |||
_subjectBuffer = subjectBuffer; | |||
_globalOptions = globalOptions; | |||
|
|||
// Note: because we use frozen-partial documents for semantic classification, we may end up with incomplete |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
...s/Core/Classification/Semantic/AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a lot of concerns that this is breaking core functionality in Roslyn. By removing this necessary (but currently broken?) system, we are now in a position where we not only have to fix it, but we also have to go back and find all the places to add it back. |
I discussed with Todd potential options that actually would be correct from a design perspective. If we wanted to add them back in, it would not be difficult to do. I don't see the point in keeping expensive and non functional code around. No one is helped by that. |
This system doesn't work in the current 'frozen snapshot' model that the workspace has moved to. THe workspace's current model is that when you ask for a frozen partial (FP) snapshot off of hte 'current' snapshot, that that FP snapshot is computed and cached so that you get the same one in the future for all further callers (until the workspace's CurrentSolution is actually updated).
We also updated FP snapshots so that they will always benefit from any parsed files in the projects (previously, the projects had to parse all files until you would see any of them). These changes made things much simpler, and meant we both weren't recomputing work and we were benefiting from work that had been done (including for future FP snapshots).
However, this changes things in that some features basically hardcoded in an idea that they would just 'try again' at a later point, with the belief that they would then go 'better' results since things would have changed underneath them with the same original snapshot. But that does not hold, meaning there was just extra complexity (esp. on a cpu level) for no actual benefit.
Practically, this is not likely to matter much in practice. That's because:
So the time period to observe incorrect results is now narrower. Given that this wasn't working anyways, and that the case where this matters is far narrowed, the code has now been removed for simplicity.