-
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
Use compile-time solution for solution crawler and EnC #52537
Conversation
Is this always or is this only when running? We should chat about the implications, just because it sounds scary 😄 |
Always on. That's what I wanted to chat about on Fri. |
@mavasani PTAL |
CTI validated the change here. Consider me signed off! |
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.
Ugh. I applaud you for keeping the hack relatively self-contained.
namespace Microsoft.VisualStudio.LanguageServices | ||
{ | ||
/// <summary> | ||
/// Provides a compile-time view of the current workspace solution. |
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 admit I didn't care for the name "compile-time" because it was ambiguous in precisely this way -- we didn't want to call it "RuntimeSolutionProvider"?
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 don't follow. What is it ambiguous with?
src/Features/Core/Portable/Workspace/CompileTimeSolutionProvider.cs
Outdated
Show resolved
Hide resolved
_lazyCompileTimeSolution = currentDesignTimeSolution | ||
.RemoveAnalyzerConfigDocuments(configIdsToRemove.ToImmutable()) | ||
.RemoveDocuments(documentIdsToRemove.ToImmutable()); |
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.
Note that trying to do a "single" remove operation here rather than just putting it inside the loop over each project state might actually be slower: RemoveDocuments here only works by doing a GroupBy(d => d.ProjectId) and then processing each group individually.
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.
OK, I'll revisit.
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.
Observations:
- The equivalent Remove methods on Project call the Solution ones - so removing multiple documents from each project is worse than from the Solution.
- Removing each document individually seems to create a lot throw away objects.
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'll follow up on this in a separate PR if we conclude there is a better way.
Implements #51265
As a side effect Razor design-time documents are no longer used for reporting diagnostics.
Only impacts .NET 6 projects -- when source generators are used for Razor projects and when Razor LSP editor is enabled (
Razor.LSP.Editor
feature flag).Validation build: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/317367