File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/FluentAssertions.Analyzers.FluentAssertionAnalyzerDocsGenerator Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 5
5
using System . Reflection ;
6
6
using System . Text ;
7
7
using System . Threading . Tasks ;
8
+ using FluentAssertions . Analyzers . TestUtils ;
8
9
using Microsoft . CodeAnalysis ;
9
10
using Microsoft . CodeAnalysis . CSharp ;
10
11
using Microsoft . CodeAnalysis . CSharp . Syntax ;
@@ -17,10 +18,10 @@ public class DocsGenerator
17
18
{
18
19
public async Task Execute ( )
19
20
{
20
- DiagnosticAnalyzer analyzer = new FluentAssertionsAnalyzer ( ) ;
21
+ var analyzers = ImmutableArray . Create ( CodeAnalyzersUtils . GetAllAnalyzers ( ) ) ;
21
22
22
23
var compilation = await FluentAssertionAnalyzerDocsUtils . GetFluentAssertionAnalyzerDocsCompilation ( ) ;
23
- var compilationWithAnalyzers = compilation . WithAnalyzers ( ImmutableArray . Create ( analyzer ) ) ;
24
+ var compilationWithAnalyzers = compilation . WithAnalyzers ( analyzers ) ;
24
25
25
26
var testAssembly = typeof ( FluentAssertionAnalyzerDocs . FluentAssertionsAnalyzerTests ) . Assembly ;
26
27
@@ -150,7 +151,7 @@ public async Task Execute()
150
151
}
151
152
152
153
var diagnostics = await compilationWithAnalyzers . GetAllDiagnosticsAsync ( ) ;
153
- foreach ( var diagnostic in diagnostics . Where ( diagnostic => analyzer . SupportedDiagnostics . Any ( d => d . Id == diagnostic . Id ) ) )
154
+ foreach ( var diagnostic in diagnostics . Where ( diagnostic => analyzers . Any ( analyzer => analyzer . SupportedDiagnostics . Any ( d => d . Id == diagnostic . Id ) ) ) )
154
155
{
155
156
Console . WriteLine ( $ "source: { root . FindNode ( diagnostic . Location . SourceSpan ) } ") ;
156
157
Console . WriteLine ( $ " diagnostic: { diagnostic } ") ;
Original file line number Diff line number Diff line change 13
13
<PackageReference Include =" Microsoft.CodeAnalysis.Workspaces.MSBuild" Version =" 4.3.1" PrivateAssets =" all" />
14
14
<PackageReference Include =" Microsoft.Build.Locator" Version =" 1.7.1" />
15
15
<ProjectReference Include =" ..\FluentAssertions.Analyzers\FluentAssertions.Analyzers.csproj" />
16
+ <ProjectReference Include =" ..\FluentAssertions.Analyzers.TestUtils\FluentAssertions.Analyzers.TestUtils.csproj" />
16
17
<ProjectReference Include =" ..\FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs\FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs.csproj" />
17
18
</ItemGroup >
18
19
You can’t perform that action at this time.
0 commit comments