-
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
WithFrozenPartialSemantics freezing linked documents #66904
Conversation
} | ||
|
||
var linkedDocs = docBuilder.AsImmutable(); | ||
var linkedTrees = treeBuilder.AsImmutable(); |
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.
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.
actually... i don't know why you even need these. i also don't know why they're called linkedXXX since they also contain the non-linked items.
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
@@ -1685,6 +1697,48 @@ public SolutionState WithFrozenPartialCompilationIncludingSpecificDocument(Docum | |||
} | |||
} | |||
|
|||
internal ImmutableArray<DocumentId> GetRelatedDocumentIds(DocumentId documentId) |
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.
public?
return false; | ||
} | ||
|
||
return projectState?.ProjectInfo.Language == args.language; |
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 projectState?.ProjectInfo.Language == args.language; | |
return projectState.ProjectInfo.Language == args.language; |
|
||
private static ImmutableArray<DocumentId> FilterDocumentIdsByLanguage(SolutionState solution, ImmutableArray<DocumentId> documentIds, string language) | ||
=> documentIds.WhereAsArray( | ||
(documentId, 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.
(documentId, args) => | |
static (documentId, args) => |
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CoreTest/SolutionTests/SolutionWithSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
* wip * Add test * fix * feedback * feedback * wip * fix * cleanup * feedback * fix * remove unused method * formatting * feedback --------- Co-authored-by: [email protected] <[email protected]>
17.5 port: WithFrozenPartialSemantics freezing linked documents (#66904)
Fixes: AB#1744772
Previously, when calling Document's
WithFrozenPartialSemantics
we would only freeze that document. Changed it so we retrieve all the linked documents as well and freeze all of them.