未验证 提交 469db3d7 编写于 作者: J Jeff Layton 提交者: GitHub

Logging Generator: messaging fix (#54080)

上级 342e4cd6
......@@ -323,7 +323,7 @@ public IReadOnlyList<LoggerClass> GetLogClasses(IEnumerable<ClassDeclarationSynt
if (!found)
{
Diag(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument, ma.GetLocation(), t);
Diag(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument, ma.GetLocation(), t.Key);
}
}
}
......
......@@ -177,7 +177,7 @@
<value>Argument is not referenced from the logging message</value>
</data>
<data name="TemplateHasNoCorrespondingArgumentMessage" xml:space="preserve">
<value>Template {0} is not provided as argument to the logging method</value>
<value>Template '{0}' is not provided as argument to the logging method</value>
</data>
<data name="TemplateHasNoCorrespondingArgumentTitle" xml:space="preserve">
<value>Logging template has no corresponding method argument</value>
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -153,8 +153,8 @@
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentMessage">
<source>Template {0} is not provided as argument to the logging method</source>
<target state="new">Template {0} is not provided as argument to the logging method</target>
<source>Template '{0}' is not provided as argument to the logging method</source>
<target state="new">Template '{0}' is not provided as argument to the logging method</target>
<note />
</trans-unit>
<trans-unit id="TemplateHasNoCorrespondingArgumentTitle">
......
......@@ -93,6 +93,7 @@ partial class C
Assert.Single(diagnostics);
Assert.Equal(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument.Id, diagnostics[0].Id);
Assert.Contains("Template 'foo' is not provided as argument to the logging method", diagnostics[0].GetMessage(), StringComparison.InvariantCulture);
}
[Fact]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册