-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix ArgumentException in SeparatedSyntaxList.ReplaceSeparator to use proper message and paramName #80690
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
base: main
Are you sure you want to change the base?
Fix ArgumentException in SeparatedSyntaxList.ReplaceSeparator to use proper message and paramName #80690
Changes from 2 commits
67676fd
b721b49
7d9aee6
c854f33
529cd8b
fb6733a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -573,13 +573,13 @@ public SeparatedSyntaxList<TNode> ReplaceSeparator(SyntaxToken separatorToken, S | |
var index = nodesWithSeps.IndexOf(separatorToken); | ||
if (index < 0) | ||
{ | ||
throw new ArgumentException("separatorToken"); | ||
throw new ArgumentException(CodeAnalysisResources.MissingListItem, nameof(separatorToken)); | ||
} | ||
|
||
if (newSeparator.RawKind != nodesWithSeps[index].RawKind || | ||
newSeparator.Language != nodesWithSeps[index].Language) | ||
{ | ||
throw new ArgumentException("newSeparator"); | ||
throw new ArgumentException("New separator must have the same RawKind and Language as the separator being replaced.", nameof(newSeparator)); | ||
|
||
} | ||
|
||
return new SeparatedSyntaxList<TNode>(nodesWithSeps.Replace(separatorToken, newSeparator)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove these tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed the test methods in commit 7c89d.