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

Update features to fork solution once instead of forking once per changed document. #73396

Merged
merged 19 commits into from
May 9, 2024

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 9, 2024 00:14
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 9, 2024
produceItems: static async (document, callback, fallbackOptions, cancellationToken) =>
{
if (await document.IsGeneratedCodeAsync(cancellationToken).ConfigureAwait(false))
return;
Copy link
Member Author

Choose a reason for hiding this comment

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

view with whitespace off.

document = await RemoveUnnecessaryImportsWorkerAsync(
document,
CreateImports(document, names, withFormatterAnnotation: false),
cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

this was wacky. we were updating the documents serially, and then doing a parallel processing of it below.

where TDocumentState : TextDocumentState
{
return UpdateDocumentsInMultipleProjects(projectIdAndNewDocuments, addDocumentsToProjectState);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

removed this

=> oldDocument.TryGetText(out var oldText) && text == oldText;
}

private SolutionCompilationState WithDocumentContents<TContent>(
Copy link
Member Author

Choose a reason for hiding this comment

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

added this helper used by WithDocumentTexts and WithDocumentSyntaxRoots

@CyrusNajmabadi CyrusNajmabadi changed the title Update features to update solutoin once instead of forking once per changed document. Update features to fork solution once instead of forking once per changed document. May 9, 2024
Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -241,17 +242,26 @@ CodeAction CreateNewCodeAction(string actionName, bool allOccurrences, Introduce
var rewriter = new IntroduceParameterDocumentRewriter(this, originalDocument,
expression, methodSymbol, containingMethod, selectedCodeAction, fallbackOptions, allOccurrences);
Copy link
Member Author

Choose a reason for hiding this comment

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

i checked, and rewriter should be safe to use concurrently from within produceItems below.

@CyrusNajmabadi CyrusNajmabadi merged commit a9559f6 into dotnet:main May 9, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 9, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the updateDocumentsAtOnce branch May 9, 2024 02:09
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski For review when you get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants