Split code fixers into their own assembly and move to Roslyn 5.0.0#128
Merged
Merged
Conversation
The command-line compiler ships only the compiler-layer Roslyn assemblies, so an analyzer assembly that references Microsoft.CodeAnalysis.Workspaces risks failing to load outside the IDE (CS8032), silently disabling the diagnostics in CI. The code-fix providers now live in a separate StrongTypes.Analyzers.CodeFixes assembly that carries the Workspaces reference; the analyzer assembly references only Microsoft.CodeAnalysis.CSharp. Both DLLs still ship in the main package under analyzers/dotnet/cs. Since the library targets net10.0 only, every consumer's compiler is at least Roslyn 5.0 — pinning 4.11.0 bought no compatibility, so the analyzer, code-fix, source-generator, and test projects now build against Microsoft.CodeAnalysis 5.0.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
KaliCZ
enabled auto-merge (squash)
July 17, 2026 14:46
CoverageLines: 4818 / 6386 (75.4%) Branches: 2520 / 3294 (76.5%) Files changed in this PR
StrongTypes — lines 89.1% (1946/2183), branches 87.8% (1245/1418)Booleans — lines 100.0% (14/14), branches 84.6% (22/26)
Collections — lines 90.2% (276/306), branches 85.1% (114/134)
ComponentModel — lines 89.5% (17/19), branches 68.8% (11/16)
Digits — lines 82.7% (86/104), branches 93.8% (30/32)
Emails — lines 97.4% (74/76), branches 95.7% (44/46)
Enums — lines 100.0% (58/58), branches 95.5% (21/22)
Exceptions — lines 78.9% (15/19), branches 50.0% (7/14)
Intervals — lines 96.5% (382/396), branches 95.5% (231/242)
Maybe — lines 92.1% (151/164), branches 83.9% (94/112)
Nullables — lines 100.0% (12/12), branches 83.3% (20/24)
Numbers — lines 100.0% (84/84), branches 94.4% (17/18)
Result — lines 98.5% (333/338), branches 95.6% (417/436)
Strings — lines 84.7% (133/157), branches 84.4% (54/64)
generated — lines 71.3% (311/436), branches 70.3% (163/232)
StrongTypes.Analyzers — lines 93.7% (369/394), branches 85.5% (183/214)(root) — lines 93.7% (369/394), branches 85.5% (183/214)
StrongTypes.Analyzers.CodeFixes — lines 89.5% (145/162), branches 80.3% (61/76)(root) — lines 89.5% (145/162), branches 80.3% (61/76)
StrongTypes.Api — lines 97.3% (391/402), branches 86.3% (88/102)(root) — lines 100.0% (11/11), branches n/a (0/0)
Controllers — lines 97.0% (226/233), branches 86.3% (88/102)
Data — lines 100.0% (102/102), branches n/a (0/0)
Entities — lines 85.2% (23/27), branches n/a (0/0)
Models — lines 100.0% (29/29), branches n/a (0/0)
StrongTypes.AspNetCore — lines 89.3% (151/169), branches 84.5% (71/84)(root) — lines 89.3% (151/169), branches 84.5% (71/84)
StrongTypes.AspNetCore.TestApi — lines 91.5% (43/47), branches 92.5% (37/40)(root) — lines 100.0% (6/6), branches n/a (0/0)
Controllers — lines 90.2% (37/41), branches 92.5% (37/40)
StrongTypes.Configuration — lines 97.5% (79/81), branches 83.3% (40/48)(root) — lines 97.5% (79/81), branches 83.3% (40/48)
StrongTypes.Configuration.Tests.NullableDisabled — lines 100.0% (3/3), branches n/a (0/0)(root) — lines 100.0% (3/3), branches n/a (0/0)
StrongTypes.EfCore — lines 95.4% (227/238), branches 81.2% (78/96)(root) — lines 95.4% (227/238), branches 81.2% (78/96)
StrongTypes.FsCheck — lines 81.9% (127/155), branches 100.0% (2/2)(root) — lines 81.9% (127/155), branches 100.0% (2/2)
StrongTypes.OpenApi.Core — lines 91.4% (447/489), branches 83.4% (297/356)(root) — lines 91.9% (262/285), branches 86.1% (167/194)
Inlining — lines 90.7% (185/204), branches 80.2% (130/162)
StrongTypes.OpenApi.Microsoft — lines 38.1% (450/1180), branches 41.2% (177/430)(root) — lines 94.6% (246/260), branches 74.6% (97/130)
Binding — lines 98.1% (103/105), branches 78.6% (55/70)
Collections — lines 100.0% (19/19), branches 100.0% (8/8)
Digits — lines 100.0% (11/11), branches 100.0% (2/2)
Emails — lines 100.0% (11/11), branches 100.0% (2/2)
Inlining — lines 100.0% (7/7), branches 50.0% (1/2)
Intervals — lines 100.0% (24/24), branches 100.0% (6/6)
Maybe — lines 100.0% (12/12), branches 100.0% (2/2)
Numbers — lines 100.0% (8/8), branches 100.0% (2/2)
Strings — lines 100.0% (9/9), branches 100.0% (2/2)
obj/Debug/net10.0/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator — lines 0.0% (0/714), branches 0.0% (0/204)
StrongTypes.OpenApi.Swashbuckle — lines 94.7% (266/281), branches 79.1% (174/220)(root) — lines 98.7% (77/78), branches 93.4% (71/76)
Binding — lines 88.3% (106/120), branches 64.3% (72/112)
Collections — lines 100.0% (6/6), branches 100.0% (4/4)
Digits — lines 100.0% (10/10), branches 100.0% (4/4)
Emails — lines 100.0% (10/10), branches 100.0% (4/4)
Inlining — lines 100.0% (2/2), branches n/a (0/0)
Intervals — lines 100.0% (26/26), branches 100.0% (8/8)
Maybe — lines 100.0% (13/13), branches 75.0% (3/4)
Numbers — lines 100.0% (8/8), branches 100.0% (4/4)
Strings — lines 100.0% (8/8), branches 100.0% (4/4)
StrongTypes.OpenApi.TestApi.Microsoft — lines 41.0% (163/398), branches 31.6% (65/206)(root) — lines 100.0% (14/14), branches 100.0% (2/2)
obj/Debug/net10.0/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator — lines 38.8% (149/384), branches 30.9% (63/204)
StrongTypes.OpenApi.TestApi.Shared — lines 0.0% (0/193), branches n/a (0/0)(root) — lines 0.0% (0/193), branches n/a (0/0)
StrongTypes.OpenApi.TestApi.Swashbuckle — lines 100.0% (11/11), branches 100.0% (2/2)(root) — lines 100.0% (11/11), branches 100.0% (2/2)
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #128 +/- ##
=======================================
Coverage 85.09% 85.09%
=======================================
Files 172 172
Lines 4852 4852
Branches 992 995 +3
=======================================
Hits 4129 4129
Misses 494 494
Partials 229 229
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses two pieces of review feedback on the Roslyn components.
Code fixers out of the analyzer assembly
The command-line compiler ships only the compiler-layer Roslyn assemblies (
Microsoft.CodeAnalysis,.CSharp); the workspace layer (CodeFixProvider,Document, …) exists only in IDE hosts, and NuGet does not restore dependencies for DLLs underanalyzers/dotnet/cs. An analyzer assembly referencingMicrosoft.CodeAnalysis.Workspacescan therefore fail to load in command-line builds (CS8032), silently turning the diagnostics off in CI while they keep working in the IDE — the layout Roslyn's own RS1038 rule warns against.StrongTypes.Analyzers.CodeFixesproject holds the threeCodeFixProviders and theWorkspacesreference; it project-references the analyzers for the diagnostic IDs.StrongTypes.Analyzersnow references onlyMicrosoft.CodeAnalysis.CSharp.analyzers/dotnet/cs(verified in the built nupkg). The compiler finds no analyzer types in the CodeFixes DLL and never instantiates anything from it, so its Workspaces reference is harmless there; the IDE loads both.Roslyn 4.11.0 → 5.0.0
The referenced Roslyn version sets the minimum compiler that can load the generator/analyzers — but consuming a net10.0-only library already requires a toolchain whose compiler is Roslyn ≥ 5.0, so pinning 4.11.0 bought no compatibility while holding the components to a pre-C# 14 API surface. All four Roslyn-facing projects (analyzers, code fixes, source generators, analyzer tests) now build against 5.0.0.
Verification
StrongTypes.Analyzers.Testspass.Kalicz.StrongTypesnupkg containsStrongTypes.Analyzers.dll,StrongTypes.Analyzers.CodeFixes.dll, andStrongTypes.SourceGenerators.dllunderanalyzers/dotnet/cs.🤖 Generated with Claude Code