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

WithFrozenPartialSemantics freezing linked documents #66904

Merged
merged 13 commits into from
Feb 17, 2023

Conversation

akhera99
Copy link
Member

@akhera99 akhera99 commented Feb 15, 2023

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.

@akhera99 akhera99 changed the title Bugs/1436225 thread block Thread blocking issue - freeze linked documents Feb 16, 2023
@akhera99 akhera99 marked this pull request as ready for review February 16, 2023 17:18
@akhera99 akhera99 requested a review from a team as a code owner February 16, 2023 17:18
}

var linkedDocs = docBuilder.AsImmutable();
var linkedTrees = treeBuilder.AsImmutable();
Copy link
Member

Choose a reason for hiding this comment

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

ToImmutable

Copy link
Member

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.

@@ -1685,6 +1697,48 @@ public SolutionState WithFrozenPartialCompilationIncludingSpecificDocument(Docum
}
}

internal ImmutableArray<DocumentId> GetRelatedDocumentIds(DocumentId documentId)
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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) =>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(documentId, args) =>
static (documentId, args) =>

@akhera99 akhera99 changed the title Thread blocking issue - freeze linked documents WithFrozenPartialSemantics freezing linked documents Feb 17, 2023
@akhera99 akhera99 enabled auto-merge (squash) February 17, 2023 20:47
@akhera99 akhera99 merged commit 308dd64 into dotnet:main Feb 17, 2023
@ghost ghost added this to the Next milestone Feb 17, 2023
arunchndr pushed a commit that referenced this pull request Mar 1, 2023
* wip

* Add test

* fix

* feedback

* feedback

* wip

* fix

* cleanup

* feedback

* fix

* remove unused method

* formatting

* feedback

---------

Co-authored-by: [email protected] <[email protected]>
arunchndr added a commit that referenced this pull request Mar 1, 2023
17.5 port: WithFrozenPartialSemantics freezing linked documents (#66904)
@RikkiGibson RikkiGibson modified the milestones: Next, 17.6 P2 Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants