Skip to content

Commit d170c06

Browse files
committed
Remove use of obsolete overload Compilation.WithAnalyzers using a CancellationToken
1 parent 57ba67c commit d170c06

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Diff for: Directory.Packages.props

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
These items impact our compatibility with SDK versions, so follow
1313
to strike a balance between compatibility and modernity.
1414
15-
These are the two main documents to reference how the Public API impacts users:
16-
- https://github.com/dotnet/roslyn/blob/main/docs/wiki/NuGet-packages.md
15+
These are the three main documents to reference how the Public API impacts users:
16+
- https://github.com/dotnet/roslyn/blob/main/docs/wiki/NuGet-packages.md?plain=1
17+
- https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs#lifecycle
1718
- https://learn.microsoft.com/en-us/visualstudio/productinfo/vs-servicing
1819
-->
19-
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
20-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.3.1" />
20+
<!-- We are using 4.8, which introduces .NET 8 and supports VS 2022 17.8 -->
21+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8" />
22+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8" />
2123
</ItemGroup>
2224
<ItemGroup>
25+
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
2326
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
2427
<PackageVersion Include="BenchmarkDotNet.Diagnostics.dotTrace" Version="0.13.12" />
2528
<PackageVersion Include="GetPackFromProject" Version="1.0.6" />

Diff for: tests/EffectiveCSharp.Analyzers.Benchmarks/Helpers/BenchmarkCSharpCompilationFactory.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ internal static class BenchmarkCSharpCompilationFactory
1616
throw new InvalidOperationException("Failed to create compilation");
1717
}
1818

19-
CompilationWithAnalyzers baseline = compilation.WithAnalyzers([new EmptyDiagnosticAnalyzer()], options, CancellationToken.None);
20-
CompilationWithAnalyzers test = compilation.WithAnalyzers([new TAnalyzer()], options, CancellationToken.None);
19+
CompilationWithAnalyzers baseline = compilation.WithAnalyzers([new EmptyDiagnosticAnalyzer()], options);
20+
CompilationWithAnalyzers test = compilation.WithAnalyzers([new TAnalyzer()], options);
2121

2222
return (baseline, test);
2323
}
@@ -35,9 +35,9 @@ internal static class BenchmarkCSharpCompilationFactory
3535
throw new InvalidOperationException("Failed to create compilation");
3636
}
3737

38-
CompilationWithAnalyzers baseline = compilation.WithAnalyzers([new EmptyDiagnosticAnalyzer()], options, CancellationToken.None);
39-
CompilationWithAnalyzers test1 = compilation.WithAnalyzers([new TAnalyzer1()], options, CancellationToken.None);
40-
CompilationWithAnalyzers test2 = compilation.WithAnalyzers([new TAnalyzer2()], options, CancellationToken.None);
38+
CompilationWithAnalyzers baseline = compilation.WithAnalyzers([new EmptyDiagnosticAnalyzer()], options);
39+
CompilationWithAnalyzers test1 = compilation.WithAnalyzers([new TAnalyzer1()], options);
40+
CompilationWithAnalyzers test2 = compilation.WithAnalyzers([new TAnalyzer2()], options);
4141

4242
return (baseline, test1, test2);
4343
}

0 commit comments

Comments
 (0)