Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Compilers/Core/Portable/CodeAnalysisResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@
<data name="MissingListItem" xml:space="preserve">
<value>The item specified is not the element of a list.</value>
</data>
<data name="SeparatorTokenMustHaveSameRawKind" xml:space="preserve">
<value>New separator must have the same RawKind as the separator being replaced.</value>
</data>
<data name="SeparatorTokenMustHaveSameLanguage" xml:space="preserve">
<value>New separator must have the same Language as the separator being replaced.</value>
</data>
<data name="InvalidPublicKey" xml:space="preserve">
<value>Invalid public key.</value>
</data>
Expand Down
12 changes: 8 additions & 4 deletions src/Compilers/Core/Portable/Syntax/SeparatedSyntaxList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,17 @@ 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)
if (newSeparator.RawKind != nodesWithSeps[index].RawKind)
{
throw new ArgumentException("newSeparator");
throw new ArgumentException(CodeAnalysisResources.SeparatorTokenMustHaveSameRawKind, nameof(newSeparator));
}

if (newSeparator.Language != nodesWithSeps[index].Language)
{
throw new ArgumentException(CodeAnalysisResources.SeparatorTokenMustHaveSameLanguage, nameof(newSeparator));
}

return new SeparatedSyntaxList<TNode>(nodesWithSeps.Replace(separatorToken, newSeparator));
Expand Down
10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Compilers/Core/Portable/xlf/CodeAnalysisResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.