Repository navigation
Split analyzer and code fix projects - #4992
Open
rockfordlhotka wants to merge 2 commits into
Open
rockfordlhotka wants to merge 2 commits into
rockfordlhotka wants to merge 2 commits into
Conversation
Move the 13 CodeFixProviders out of Csla.Analyzers into a new Csla.Analyzers.CodeFixes project. The analyzer assembly now references only Microsoft.CodeAnalysis.CSharp (no Workspaces), so the blanket RS1038 suppression is removed. Both assemblies are still bundled into the Csla package under analyzers/dotnet/cs via CslaPackBundledAnalyzers. - Code fixes keep their namespaces; they reach the analyzer's internal extension helpers through InternalsVisibleTo - PolyUseEmbeddedAttribute on Csla.Analyzers so its internal polyfills don't clash with the code fix project's own Polyfill copy - Add the new project to the analyzer tests, solutions and VSIX - Fix the stale tests path in Csla.Analyzers.sln Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new VSIX solution mappings cause x64/x86 builds to fail, and the standalone analyzer package omits the moved code-fix DLL.
2 open issues
What changed in this PR
Separates CSLA’s code fixes from its diagnostic analyzers to address #4638, removing the analyzer assembly’s Workspaces dependency while bundling both assemblies in the main Csla package.
Changes:
- Moves 13 code-fix providers into a dedicated project, preserving their namespaces and implementation.
- Updates dependencies, internal access, and polyfill settings; removes the RS1038 suppression.
- Integrates the new assembly into packaging, tests, solutions, and the VSIX.
| File | Description |
|---|---|
| Source/tests/Csla.Analyzers.Tests/Csla.Analyzers.Tests.csproj | References the new code-fix project. |
| Source/Csla/Csla.csproj | Builds and bundles the code-fix assembly. |
| Source/csla.test.sln | Adds code fixes and repairs a project terminator. |
| Source/csla.maui.build.sln | Adds code fixes to MAUI build configurations. |
| Source/csla.build.sln | Adds code fixes to framework build configurations. |
| Source/Csla.Analyzers/Csla.Analyzers/Properties/AssemblyInfo.cs | Grants code fixes access to internal helpers. |
| Source/Csla.Analyzers/Csla.Analyzers/GlobalSuppressions.cs | Removes the RS1038 suppression. |
| Source/Csla.Analyzers/Csla.Analyzers/Csla.Analyzers.csproj | Drops Workspaces and hides internal polyfills. |
| Source/Csla.Analyzers/Csla.Analyzers.Vsix/source.extension.vsixmanifest | Registers the code-fix assembly as VSIX assets. |
| Source/Csla.Analyzers/Csla.Analyzers.Vsix/Csla.Analyzers.Vsix.csproj | References the code-fix project. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/UseGeneratedDataPortalExtensionCodeFix.cs | Relocates the generated-extension fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/TypeWithOperationsShouldBePartialAddPartialCodeFix.cs | Relocates the partial-type fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/Properties/AssemblyInfo.cs | Grants tests internal access. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/ManagedBackingFieldUsesNameof/EvaluateManagedBackingFieldsNameofCodeFix.cs | Relocates the nameof fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/IsOperationMethodPublicMakeNonPublicCodeFix.cs | Relocates the operation-visibility fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/IsCompleteCalledInAsynchronousBusinessRuleRemoveCallCodeFix.cs | Relocates the Complete-call removal fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/FindSaveAssignmentIssueAnalyzerAddAsyncAssignmentCodeFix.cs | Relocates the asynchronous save-assignment fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/FindSaveAssignmentIssueAnalyzerAddAssignmentCodeFix.cs | Relocates the save-assignment fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/FindOperationsWithIncorrectReturnTypeResolveCorrectTypeCodeFix.cs | Relocates the operation return-type fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/EvaluateManagedBackingFieldsCodeFix.cs | Relocates the backing-field modifier fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/DoesOperationHaveAttributeAddAttributeCodeFix.cs | Relocates the operation-attribute fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/DoesChildOperationHaveRunLocalRemoveAttributeCodeFix.cs | Relocates the RunLocal-removal fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/Csla.Analyzers.CodeFixes.csproj | Defines the non-packable code-fix project. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/CheckConstructorsAnalyzerPublicConstructorCodeFix.cs | Relocates the public-constructor fix. |
| Source/Csla.Analyzers/Csla.Analyzers.CodeFixes/AsynchronousBusinessRuleInheritingFromBusinessRuleChangeToBusinessRuleAsyncCodeFix.cs | Relocates the asynchronous business-rule conversion fix. |
| Source/Csla.Analyzers.sln | Adds code fixes, corrects the test path, and expands platform mappings. |
Review effort: Balanced
- Delete Csla.Analyzers.Vsix: VS 2017-only, non-SDK project that no CI solution builds; the analyzers ship in the Csla package and can be debugged via the existing DebugRoslynComponent launch profile - Rebuild Csla.Analyzers.sln from main with only Any CPU mappings, replacing the VSIX entry with Csla.Analyzers.CodeFixes - Mark Csla.Analyzers IsPackable=false and drop its pack-only items and packages.config-era tools/install.ps1 and uninstall.ps1; the package was never published (its output never reaches bin/packages) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
This branch has not been deployed
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.


Summary
CodeFixProviders out ofCsla.Analyzersinto a newCsla.Analyzers.CodeFixesproject (git mv, namespaces unchanged).Csla.Analyzersnow references onlyMicrosoft.CodeAnalysis.CSharp(no Workspaces), so the blanketRS1038suppression (GlobalSuppressions.cs) is removed.analyzers/dotnet/cs/via the existingCslaPackBundledAnalyzerstarget. The new project isIsPackable=false, so no new package.InternalsVisibleTo. AddedPolyUseEmbeddedAttributetoCsla.Analyzers(same asCsla.csproj) so its internal polyfills don't clash with the code fix project's own Polyfill copy.Csla.Analyzers.sln,csla.build.sln,csla.test.slnandcsla.maui.build.sln.Csla.Analyzers.sln(Csla.Analyzers\Csla.Analyzers.Tests→tests\Csla.Analyzers.Tests); the solution now builds withdotnet build.Csla.Analyzers.Vsix: VS 2017-only, non-SDK project not built by any CI solution, and redundant with the analyzers shipping in the Csla package. Analyzer debugging uses the existingDebugRoslynComponentlaunch profile.Csla.Analyzerspackage path: it was never published (its nupkg never reachedbin/packages), so the project is nowIsPackable=falseand its pack-only items and packages.config-eratools/*.ps1scripts are removed.Release note
Not a breaking change for package consumers: diagnostic IDs, severities and code fixes are unchanged, and the IDE loads both DLLs from the package automatically. The only people affected are those who reference
Csla.Analyzers.dlldirectly by path, who would also need to addCsla.Analyzers.CodeFixes.dllto keep the light-bulb fixes.Test plan
dotnet build Source/csla.test.sln: 0 errors, no warnings from the analyzer projectsdotnet test Source/csla.test.sln --filter TestCategory!=SkipOnCIServer: all 25 test runs pass (Csla.Analyzers.Tests: 455/455 on net10.0 and net11.0)dotnet pack Source/Csla/Csla.csproj -c Release: nupkg containsanalyzers/dotnet/cs/Csla.Analyzers.dll,Csla.Analyzers.CodeFixes.dll,Csla.Generator.AutoImplementProperties.CSharp.dllCsla.Analyzers.dllassembly references no longer includeMicrosoft.CodeAnalysis.Workspacesdotnet build Source/Csla.Analyzers.slnsucceedsCloses #4638
🤖 Generated with Claude Code