Skip to content

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Aug 6, 2025

@davidwengier davidwengier requested a review from a team as a code owner August 6, 2025 02:35
protected override Task<VoidResult> HandleRequestAsync(TextDocumentIdentifier textDocument, RazorCohostRequestContext requestContext, CancellationToken cancellationToken)
{
_htmlDocumentSynchronizer.DocumentRemoved(requestContext.DocumentUri.AssumeNotNull().GetRequiredParsedUri(), cancellationToken);
_htmlDocumentSynchronizer.DocumentRemoved(textDocument.DocumentUri.GetRequiredParsedUri(), cancellationToken);
Copy link
Member Author

Choose a reason for hiding this comment

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

requestContext.DocumentUri is shorthand for requestContext.TextDocument?.Uri(), but if a file has been deleted then TextDocument could be null, but we still want to clean up state.

@davidwengier davidwengier merged commit 87b8cc5 into dotnet:main Aug 6, 2025
11 checks passed
@davidwengier davidwengier deleted the FixDocumentCloseCrash branch August 6, 2025 21:53
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 6, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants