-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Keep as much parsed state as we can when producing frozen compilations #72184
Conversation
@jasonmalinowski @ToddGrun this is ready for review. |
return state switch | ||
{ | ||
// If we don't have an existing state, then transition to a project state without any data. | ||
null => this.ProjectState, |
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.
intentionally changes. teh RemoveAllDocuments is now in GetFrozenCompilationState
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.
If that's the case then update the comment.
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.
And at this point, I just want to see GetIniitalProjectState combined with the other function. There's now two functions that both have the same switches and you can only understand how this works if I look at both of them at once. It's far more cognitive load to understand the structure than just one bigger method here.
@@ -641,35 +641,41 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke | |||
if (state is FinalCompilationTrackerState { IsFrozen: true } finalState) | |||
return this; | |||
|
|||
var projectState = state switch |
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.
view with whitespace off.
} | ||
} | ||
|
||
frozenProjectState = frozenProjectState.AddDocuments(documentsWithTrees.ToImmutableAndClear()); |
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.
i'd prefer to drive this based on allocation profiles. immutable types really help us ensure no mistakes.
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.
return state switch | ||
{ | ||
// If we don't have an existing state, then transition to a project state without any data. | ||
null => this.ProjectState, |
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.
And at this point, I just want to see GetIniitalProjectState combined with the other function. There's now two functions that both have the same switches and you can only understand how this works if I look at both of them at once. It's far more cognitive load to understand the structure than just one bigger method here.
src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs
Outdated
Show resolved
Hide resolved
…ationState.CompilationTracker.cs Co-authored-by: Jason Malinowski <[email protected]>
No description provided.