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

Fixes dotnet/roslyn-analyzers#7536 #7538

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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

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.

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.

Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ public async Task SingleString_EmitFormatMethodsCSharpAsync(
bool emitFormatMethods)
{
var code = ResxHeader
+ $@" <data name=""Name"" xml:space=""preserve"">
+ $@" <data name=""Name.with.dots"" xml:space=""preserve"">
<value>value {{{placeholder}}}</value>
<comment>comment</comment>
</data>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public bool Execute(CancellationToken cancellationToken)
if (resourceString.HasArguments)
{
RenderDocComment(language, memberIndent, strings, docCommentString);
RenderFormatMethod(memberIndent, language, CompilationInformation.SupportsNullable, strings, resourceString);
RenderFormatMethod(memberIndent, language, CompilationInformation.SupportsNullable, strings, resourceString, identifier);
}
}

Expand Down Expand Up @@ -811,9 +811,9 @@ private static void SplitName(string fullName, out string? namespaceName, out st
}
}

private static void RenderFormatMethod(string indent, Lang language, bool supportsNullable, StringBuilder strings, ResourceString resourceString)
private static void RenderFormatMethod(string indent, Lang language, bool supportsNullable, StringBuilder strings, ResourceString resourceString, string identifier)
{
strings.AppendLine($"{indent}internal static string Format{resourceString.Name}({resourceString.GetMethodParameters(language, supportsNullable)})");
strings.AppendLine($"{indent}internal static string Format{identifier}({resourceString.GetMethodParameters(language, supportsNullable)})");
if (resourceString.UsingNamedArgs)
{
strings.AppendLine($@"{indent} => string.Format(Culture, GetResourceString(""{resourceString.Name}"", new[] {{ {resourceString.GetArgumentNames()} }}), {resourceString.GetArguments()});");
Expand Down
1 change: 0 additions & 1 deletion src/NetAnalyzers/RulesMissingDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
Rule ID | Missing Help Link | Title |
--------|-------------------|-------|
CA2023 | <https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2023> | Invalid braces in message template |
CA2024 | <https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2024> | Do not use 'StreamReader.EndOfStream' in async methods |