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

#54008 Issue Fix #54058

Closed
wants to merge 17 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -219,4 +219,4 @@
<data name="GeneratingForMax6ArgumentsMessage" xml:space="preserve">
<value>Generating more than 6 arguments is not supported</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -164,4 +164,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down