Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

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

  • New project: IntelliTect.Analyzer.CodeFixes containing all code fix providers
  • Dependency split: Moved Microsoft.CodeAnalysis.CSharp.Workspaces reference from analyzer to code fixes project; analyzer now references only Microsoft.CodeAnalysis.CSharp
  • Packaging: Both assemblies packaged to analyzers/dotnet/cs/ in NuGet
  • Removed: RS1038 suppression from .editorconfig

Structure

IntelliTect.Analyzer/              # Analyzers only, no Workspaces dependency
├── Analyzers/
│   ├── AsyncVoid.cs
│   └── ...

IntelliTect.Analyzer.CodeFixes/    # Code fix providers with Workspaces dependency
├── AsyncVoid.cs
├── AttributesOnSeparateLines.cs
└── ...

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
    • Triggering command: /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)
    • Triggering command: /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)
    • Triggering command: /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
    • Triggering command: /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

Resolve this suppression:

###############################

Analyzer Package Suppressions

###############################

RS1038: Compiler extensions should not be implemented in assemblies with compiler-provided references

This rule is suppressed because our analyzer and code fix providers are in the same assembly,

which is a common pattern. The code fix providers require Microsoft.CodeAnalysis.Workspaces.

dotnet_diagnostic.RS1038.severity = none

https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Resolve RS1038 suppression in analyzer package Resolve RS1038: Separate code fix providers into dedicated assembly Feb 3, 2026
Copy link
Contributor

Copilot AI left a 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.CodeFixes project 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.

@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review February 3, 2026 01:31
@BenjaminMichaelis BenjaminMichaelis enabled auto-merge (squash) February 3, 2026 01:36
@BenjaminMichaelis BenjaminMichaelis merged commit 175e98a into main Feb 3, 2026
2 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the copilot/resolve-suppression-rs1038 branch February 3, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants