mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-23 10:05:49 +08:00
Allow to apply code fix in top-level statements
This commit is contained in:
@@ -4,13 +4,20 @@ public static class SpectreAnalyzerVerifier<TAnalyzer>
|
||||
where TAnalyzer : DiagnosticAnalyzer, new()
|
||||
{
|
||||
public static Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource)
|
||||
=> VerifyCodeFixAsync(source, new[] { expected }, fixedSource);
|
||||
=> VerifyCodeFixAsync(source, OutputKind.DynamicallyLinkedLibrary, new[] { expected }, fixedSource);
|
||||
|
||||
public static Task VerifyCodeFixAsync(string source, OutputKind outputKind, DiagnosticResult expected, string fixedSource)
|
||||
=> VerifyCodeFixAsync(source, outputKind, new[] { expected }, fixedSource);
|
||||
|
||||
private static Task VerifyCodeFixAsync(string source, IEnumerable<DiagnosticResult> expected, string fixedSource)
|
||||
private static Task VerifyCodeFixAsync(string source, OutputKind outputKind, IEnumerable<DiagnosticResult> expected, string fixedSource)
|
||||
{
|
||||
var test = new Test
|
||||
{
|
||||
TestCode = source,
|
||||
TestCode = source,
|
||||
TestState =
|
||||
{
|
||||
OutputKind = outputKind,
|
||||
},
|
||||
FixedCode = fixedSource,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user