Skip to content

Commit 9d78187

Browse files
Resolve RS1038: Separate code fix providers into new assembly
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
1 parent 87f2e3a commit 9d78187

9 files changed

Lines changed: 70 additions & 9 deletions

File tree

.editorconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,3 @@ dotnet_diagnostic.RCS1170.severity = warning
168168

169169
# RCS1213: Remove unused member declaration.
170170
dotnet_diagnostic.RCS1213.severity = warning
171-
172-
###############################
173-
# Analyzer Package Suppressions
174-
###############################
175-
# RS1038: Compiler extensions should not be implemented in assemblies with compiler-provided references
176-
# This rule is suppressed because our analyzer and code fix providers are in the same assembly,
177-
# which is a common pattern. The code fix providers require Microsoft.CodeAnalysis.Workspaces.
178-
dotnet_diagnostic.RS1038.severity = none

IntelliTect.Analyzer.sln

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,66 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1818
EndProject
1919
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntelliTect.Analyzer.Integration.Tests", "IntelliTect.Analyzer\IntelliTect.Analyzer.Integration.Tests\IntelliTect.Analyzer.Integration.Tests.csproj", "{25B557AC-D6C9-4719-A977-3DC1666C5347}"
2020
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntelliTect.Analyzer.CodeFixes", "IntelliTect.Analyzer\IntelliTect.Analyzer.CodeFixes\IntelliTect.Analyzer.CodeFixes.csproj", "{4B831B22-D64D-4BE0-8BDC-E69F728187BB}"
22+
EndProject
2123
Global
2224
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2325
Debug|Any CPU = Debug|Any CPU
26+
Debug|x64 = Debug|x64
27+
Debug|x86 = Debug|x86
2428
Release|Any CPU = Release|Any CPU
29+
Release|x64 = Release|x64
30+
Release|x86 = Release|x86
2531
EndGlobalSection
2632
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2733
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2834
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Debug|x64.ActiveCfg = Debug|Any CPU
36+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Debug|x64.Build.0 = Debug|Any CPU
37+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Debug|x86.ActiveCfg = Debug|Any CPU
38+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Debug|x86.Build.0 = Debug|Any CPU
2939
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Release|Any CPU.ActiveCfg = Release|Any CPU
3040
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Release|x64.ActiveCfg = Release|Any CPU
42+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Release|x64.Build.0 = Release|Any CPU
43+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Release|x86.ActiveCfg = Release|Any CPU
44+
{B21556AE-ABCF-41F9-8585-3C32DE919638}.Release|x86.Build.0 = Release|Any CPU
3145
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3246
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Debug|x64.ActiveCfg = Debug|Any CPU
48+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Debug|x64.Build.0 = Debug|Any CPU
49+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Debug|x86.ActiveCfg = Debug|Any CPU
50+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Debug|x86.Build.0 = Debug|Any CPU
3351
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Release|Any CPU.ActiveCfg = Release|Any CPU
3452
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Release|x64.ActiveCfg = Release|Any CPU
54+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Release|x64.Build.0 = Release|Any CPU
55+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Release|x86.ActiveCfg = Release|Any CPU
56+
{2B4BFC2E-4BD4-4651-A0F4-E926EF246ADE}.Release|x86.Build.0 = Release|Any CPU
3557
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3658
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Debug|Any CPU.Build.0 = Debug|Any CPU
59+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Debug|x64.ActiveCfg = Debug|Any CPU
60+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Debug|x64.Build.0 = Debug|Any CPU
61+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Debug|x86.ActiveCfg = Debug|Any CPU
62+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Debug|x86.Build.0 = Debug|Any CPU
3763
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Release|Any CPU.ActiveCfg = Release|Any CPU
3864
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Release|Any CPU.Build.0 = Release|Any CPU
65+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Release|x64.ActiveCfg = Release|Any CPU
66+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Release|x64.Build.0 = Release|Any CPU
67+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Release|x86.ActiveCfg = Release|Any CPU
68+
{25B557AC-D6C9-4719-A977-3DC1666C5347}.Release|x86.Build.0 = Release|Any CPU
69+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
71+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Debug|x64.ActiveCfg = Debug|Any CPU
72+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Debug|x64.Build.0 = Debug|Any CPU
73+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Debug|x86.ActiveCfg = Debug|Any CPU
74+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Debug|x86.Build.0 = Debug|Any CPU
75+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
76+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Release|Any CPU.Build.0 = Release|Any CPU
77+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Release|x64.ActiveCfg = Release|Any CPU
78+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Release|x64.Build.0 = Release|Any CPU
79+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Release|x86.ActiveCfg = Release|Any CPU
80+
{4B831B22-D64D-4BE0-8BDC-E69F728187BB}.Release|x86.Build.0 = Release|Any CPU
3981
EndGlobalSection
4082
GlobalSection(SolutionProperties) = preSolution
4183
HideSolutionNode = FALSE

IntelliTect.Analyzer/IntelliTect.Analyzer/CodeFixes/AsyncVoid.cs renamed to IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AsyncVoid.cs

File renamed without changes.

IntelliTect.Analyzer/IntelliTect.Analyzer/CodeFixes/AttributesOnSeparateLines.cs renamed to IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/AttributesOnSeparateLines.cs

File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<IncludeBuildOutput>false</IncludeBuildOutput>
6+
</PropertyGroup>
7+
8+
<PropertyGroup>
9+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
14+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="all" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\IntelliTect.Analyzer\IntelliTect.Analyzer.csproj" PrivateAssets="all" />
19+
</ItemGroup>
20+
21+
</Project>

IntelliTect.Analyzer/IntelliTect.Analyzer/CodeFixes/NamingFieldPascalUnderscore.cs renamed to IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/NamingFieldPascalUnderscore.cs

File renamed without changes.

IntelliTect.Analyzer/IntelliTect.Analyzer/CodeFixes/NamingIdentifierPascal.cs renamed to IntelliTect.Analyzer/IntelliTect.Analyzer.CodeFixes/NamingIdentifierPascal.cs

File renamed without changes.

IntelliTect.Analyzer/IntelliTect.Analyzer.Test/IntelliTect.Analyzer.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<ItemGroup>
2424
<ProjectReference Include="..\IntelliTect.Analyzer\IntelliTect.Analyzer.csproj" />
25+
<ProjectReference Include="..\IntelliTect.Analyzer.CodeFixes\IntelliTect.Analyzer.CodeFixes.csproj" />
2526
</ItemGroup>
2627

2728
</Project>

IntelliTect.Analyzer/IntelliTect.Analyzer/IntelliTect.Analyzer.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<ItemGroup>
2525
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
26-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="all" />
26+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
2727
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers">
2828
<PrivateAssets>all</PrivateAssets>
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -36,9 +36,14 @@
3636
<EmbeddedResource Update="Resources.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Resources.Designer.cs" />
3737
</ItemGroup>
3838

39+
<Target Name="EnsureCodeFixesProjectBuilt" BeforeTargets="GenerateNuspec">
40+
<MSBuild Projects="..\IntelliTect.Analyzer.CodeFixes\IntelliTect.Analyzer.CodeFixes.csproj" Targets="Build" Properties="Configuration=$(Configuration)" />
41+
</Target>
42+
3943
<ItemGroup>
4044
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
4145
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
46+
<None Include="..\IntelliTect.Analyzer.CodeFixes\bin\$(Configuration)\netstandard2.0\IntelliTect.Analyzer.CodeFixes.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
4247
<None Include="..\..\intellitect-avatar.png" Pack="true" PackagePath="" />
4348
<None Include="..\..\README.md" Pack="true" PackagePath="" />
4449
</ItemGroup>

0 commit comments

Comments
 (0)