Skip to content

Commit f52c29d

Browse files
committed
Fix: Added correct packages
1 parent b82519e commit f52c29d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/CodeOfChaos.Testing/CodeOfChaos.Testing.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
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

src/CodeOfChaos.Testing/RoslynGeneratorRunner.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ namespace CodeOfChaos.Testing;
99
// Code
1010
// ---------------------------------------------------------------------------------------------------------------------
1111
public 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

0 commit comments

Comments
 (0)