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

Allow cohosting to make changes to source generated documents #77331

Conversation

davidwengier
Copy link
Member

Needed to enable Razor completion to work with the source generator.

Part of dotnet/razor#10693

@davidwengier davidwengier requested a review from a team as a code owner February 24, 2025 22:58
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 24, 2025
@@ -81,6 +81,11 @@ private static CompletionListCache GetCache()
return InlineCompletionsHandler.GetInlineCompletionItemsAsync(logger, document, position, options, xmlSnippetParser, cancellationToken);
}

public static Document ApplyProvisionalEdit(SourceGeneratedDocument generatedDocument, SourceText updatedDocumentText)
{
return generatedDocument.Project.Solution.WithFrozenSourceGeneratedDocument(generatedDocument.Identity, DateTime.Now, updatedDocumentText);
Copy link
Member

Choose a reason for hiding this comment

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

@CyrusNajmabadi Did we use UtcNow for these, generally?

Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to update this, but just a note that the resulting document and the solution that contains it are thrown away immediately after asking for completion items from it

Copy link
Member Author

@davidwengier davidwengier Feb 25, 2025

Choose a reason for hiding this comment

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

@davidwengier
Copy link
Member Author

Superseded by #77587

@davidwengier davidwengier deleted the AllowCohostProvisionalCompletion branch March 14, 2025 00:08
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