File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 88
99 <ItemGroup >
1010 <PackageReference Include =" JetBrains.Annotations" Version =" 2024.3.0" />
11+ <PackageReference Include =" Microsoft.CodeAnalysis" Version =" 4.12.0" />
12+ <PackageReference Include =" Microsoft.CodeAnalysis.Common" Version =" 4.12.0" />
1113 <PackageReference Include =" Microsoft.CodeAnalysis.CSharp" Version =" 4.12.0" />
14+ <PackageReference Include =" Microsoft.CodeAnalysis.CSharp.Workspaces" Version =" 4.12.0" />
1215 <PackageReference Include =" Microsoft.CodeAnalysis.Workspaces.Common" Version =" 4.12.0" />
1316 </ItemGroup >
1417
Original file line number Diff line number Diff line change @@ -9,14 +9,12 @@ namespace CodeOfChaos.Testing;
99// Code
1010// ---------------------------------------------------------------------------------------------------------------------
1111public class RoslynGeneratorRunner ( LanguageVersion languageVersion = LanguageVersion . Latest ) {
12- public Compilation ? Compilation { get ; set ; }
12+ public required Compilation Compilation { get ; init ; }
1313
1414 public GeneratorDriverRunResult AddGenerator ( params IIncrementalGenerator [ ] generators ) {
1515 GeneratorDriver driver = CSharpGeneratorDriver . Create ( generators )
1616 . WithUpdatedParseOptions ( new CSharpParseOptions ( languageVersion ) ) ;
17-
18- if ( Compilation is null ) throw new InvalidOperationException ( "Compilation is null" ) ;
19-
17+
2018 return driver . RunGenerators ( Compilation ) . GetRunResult ( ) ;
2119 }
2220
You can’t perform that action at this time.
0 commit comments