-
Notifications
You must be signed in to change notification settings - Fork 16
Resolve RS1038: Separate code fix providers into dedicated assembly #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: BenjaminMichaelis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Splits Roslyn analyzers and code fix providers into separate assemblies to address RS1038 by removing Workspaces dependencies from the analyzer assembly while still shipping both assemblies together.
Changes:
- Introduces a new
IntelliTect.Analyzer.CodeFixesproject to host all code fix providers and keep Workspaces dependencies isolated. - Updates the analyzer project to reference
Microsoft.CodeAnalysis.CSharp(instead of Workspaces) and packs the code-fix DLL alongside the analyzer DLL. - Updates solution/test wiring and removes the RS1038 suppression from
.editorconfig.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| IntelliTect.Analyzer/IntelliTect.Analyzer/IntelliTect.Analyzer.csproj | Removes Workspaces reference from analyzer; ensures code-fix project builds and packs its DLL into the same NuGet analyzer folder. |
| IntelliTect.Analyzer/IntelliTect.Analyzer.Test/IntelliTect.Analyzer.Tests.csproj | Adds project reference to the new code-fixes project so code-fix tests still compile/run. |
| IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/IntelliTect.Analyzer.CodeFixes.csproj | Adds the new code-fixes project with Workspaces dependency. |
| IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AsyncVoid.cs | Code fix provider moved/added for async-void violations. |
| IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AttributesOnSeparateLines.cs | Code fix provider moved/added for attribute formatting rule. |
| IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/NamingIdentifierPascal.cs | Code fix provider moved/added for PascalCase naming rules. |
| IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/NamingFieldPascalUnderscore.cs | Code fix provider moved/added for _PascalCase field naming rule. |
| IntelliTect.Analyzer.sln | Adds the new project to the solution (plus additional configurations). |
| .editorconfig | Removes RS1038 suppression now that analyzer no longer depends on Workspaces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
IntelliTect.Analyzer/IntelliTect.Analyzer/IntelliTect.Analyzer.csproj
Outdated
Show resolved
Hide resolved
IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/IntelliTect.Analyzer.CodeFixes.csproj
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
RS1038 flags assemblies containing compiler extensions (analyzers) that reference IDE-only dependencies like
Microsoft.CodeAnalysis.Workspaces. Code fix providers require Workspaces; analyzers must not reference it.Changes
IntelliTect.Analyzer.CodeFixescontaining all code fix providersMicrosoft.CodeAnalysis.CSharp.Workspacesreference from analyzer to code fixes project; analyzer now references onlyMicrosoft.CodeAnalysis.CSharpanalyzers/dotnet/cs/in NuGet.editorconfigStructure
Both assemblies ship together in the same NuGet package and are loaded by the IDE as needed.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
pe3vsblobprodcus354.vsblob.vsassets.io/usr/share/dotnet/dotnet dotnet restore --no-dependencies /home/REDACTED/work/CodingGuidelines/CodingGuidelines/Tools/XMLtoMD/GuidelineXmlToMD.sln --packages /home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)/usr/share/dotnet/dotnet dotnet restore --no-dependencies /home/REDACTED/work/CodingGuidelines/CodingGuidelines/Tools/XMLtoMD/GuidelineXmlToMD/GuidelineXmlToMD.csproj --packages /home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)/usr/share/dotnet/dotnet dotnet restore --no-dependencies /home/REDACTED/work/CodingGuidelines/CodingGuidelines/Tools/XMLtoMD/GuidelineXmlToMD.Test/GuidelineXmlToMD.Test.csproj --packages /home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)s8mvsblobprodcus38.vsblob.vsassets.io/usr/share/dotnet/dotnet dotnet restore --no-dependencies /home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/152969D1C94CACFB2DD8DDFC3D3B91A8/missingpackages_workingdir --packages /home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /home/REDACTED/work/CodingGuidelines/.codeql-scratch/dbs/csharp/working/nugetconfig/nuget.config --force(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.