Skip to content

Conversation

ryzngard
Copy link
Contributor

Helps mitigate dotnet/vscode-csharp#8147

…nges to SourceText in LspTextChangesLoader
@ryzngard ryzngard requested a review from a team as a code owner April 10, 2025 20:45
return TextAndVersion.Create(newText, version.GetNewerVersion());
}
}
catch (ArgumentException ex)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on https://prism.vsdata.io/failure/?query=%20sev!%3DDiagnostic%20p%3Dcsdevkit&eventType=fault&failureType=hits&failureHash=a111c29f-cca2-7bfd-4add-e5573c3797ee

I left it as isolated as possible but should we just catch all exceptions? We would still want to report a fault (needs follow up with EA changes) but it can be handled

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, IMO we should catch all exceptions except OperationCancellationException. We should let that bubble up to the caller on the Roslyn side.

return TextAndVersion.Create(newText, version.GetNewerVersion());
}
}
catch (ArgumentException ex)
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, IMO we should catch all exceptions except OperationCancellationException. We should let that bubble up to the caller on the Roslyn side.


// Validate the checksum information so the edits are known to be correct
if (IsSourceTextMatching(sourceText))
try
Copy link
Member

Choose a reason for hiding this comment

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

It seems possible that the failure is on line 41 as well? I couldn't see line numbers in the stack trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldnt be possible but here we are so may be worth wrapping it all.

@ryzngard ryzngard merged commit 2a2a5f7 into dotnet:main Apr 10, 2025
11 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 10, 2025
@ryzngard ryzngard deleted the handle_argumentexception_textloader branch April 11, 2025 20:32
ryzngard pushed a commit to ryzngard/razor that referenced this pull request Apr 11, 2025
ryzngard pushed a commit to ryzngard/razor that referenced this pull request Apr 11, 2025
ryzngard pushed a commit to ryzngard/razor that referenced this pull request Apr 11, 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.

4 participants