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

Adding analyzer/fixer for the Regex Source Generator (#68976) #69872

Merged
merged 1 commit into from
May 27, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,13 @@ internal static class DiagnosticDescriptors
category: Category,
DiagnosticSeverity.Info,
isEnabledByDefault: true);

public static DiagnosticDescriptor UseRegexSourceGeneration { get; } = new DiagnosticDescriptor(
id: "SYSLIB1046",
title: new LocalizableResourceString(nameof(SR.UseRegexSourceGeneratorTitle), SR.ResourceManager, typeof(FxResources.System.Text.RegularExpressions.Generator.SR)),
messageFormat: new LocalizableResourceString(nameof(SR.UseRegexSourceGeneratorMessage), SR.ResourceManager, typeof(FxResources.System.Text.RegularExpressions.Generator.SR)),
category: Category,
DiagnosticSeverity.Info,
isEnabledByDefault: true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,10 @@
<value>Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking.</value>
<comment>{Locked="RegexOptions.NonBacktracking"}</comment>
</data>
</root>
<data name="UseRegexSourceGeneratorMessage" xml:space="preserve">
<value>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</value>
</data>
<data name="UseRegexSourceGeneratorTitle" xml:space="preserve">
<value>Convert to 'RegexGenerator'.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Neukončený komentář (?#...).</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Nicht abgeschlossener (?#...)-Kommentar.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Comentario (?#...) sin terminar.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Commentaire (?#...) inachevé.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Commento (?#...) non terminato.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">未終了の (?#...) コメントです。</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">종결되지 않은 (?#...) 주석입니다.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Niezakończony komentarz (?#...).</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Comentário (?#...) não finalizado.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Комментарий (?#...) без признака завершения.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">Sonlandırılmayan (?#...) yorumu.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">未终止的(?#...)注释。</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@
<target state="translated">未結束的 (?#...) 註解。</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorMessage">
<source>Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</source>
<target state="new">Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time.</target>
<note />
</trans-unit>
<trans-unit id="UseRegexSourceGeneratorTitle">
<source>Convert to 'RegexGenerator'.</source>
<target state="new">Convert to 'RegexGenerator'.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Loading