Skip to content

Commit

Permalink
Fixes #7536
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrzej-W committed Jan 19, 2025
1 parent 45caa45 commit 16b25a0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.

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

0 comments on commit 16b25a0

Please sign in to comment.