Skip to content

Commit 3927aae

Browse files
authored
Factor out CodeFixes and Analyzers to separate assemblies
1 parent 1ab519c commit 3927aae

23 files changed

+100
-85
lines changed

src/Framework/Analyzer/src/DelegateEndpoints/DelegateEndpointFixer.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Framework/Analyzer/src/DelegateEndpoints/DetectMismatchedParameterOptionality.Fixer.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant
6363
<ItemGroup>
6464
<!-- Note: do not add _TransitiveExternalAspNetCoreAppReference to this list. This is intentionally not listed as a direct package reference. -->
6565
<Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)" />
66-
<ProjectReference Include="..\..\Analyzer\src\Microsoft.AspNetCore.App.Analyzers.csproj"
66+
<ProjectReference Include="..\..\AspNetCoreAnalyzers\src\Analyzers\Microsoft.AspNetCore.App.Analyzers.csproj"
67+
ReferenceOutputAssembly="false"
68+
SkipGetTargetFrameworkProperties="true"
69+
UndefineProperties="TargetFramework;TargetFrameworks;RuntimeIdentifier;PublishDir" />
70+
<ProjectReference Include="..\..\AspNetCoreAnalyzers\src\CodeFixes\Microsoft.AspNetCore.App.CodeFixes.csproj"
6771
ReferenceOutputAssembly="false"
6872
SkipGetTargetFrameworkProperties="true"
6973
UndefineProperties="TargetFramework;TargetFrameworks;RuntimeIdentifier;PublishDir" />
@@ -162,6 +166,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
162166

163167
<RefPackContent Include="$(PkgMicrosoft_Internal_Runtime_AspNetCore_Transport)\$(AnalyzersPackagePath)**\*.*" PackagePath="$(AnalyzersPackagePath)" />
164168
<RefPackContent Include="$(ArtifactsDir)bin\Microsoft.AspNetCore.App.Analyzers\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.App.Analyzers.dll" PackagePath="$(AnalyzersPackagePath)dotnet/cs/" />
169+
<RefPackContent Include="$(ArtifactsDir)bin\Microsoft.AspNetCore.App.CodeFixes\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.App.CodeFixes.dll" PackagePath="$(AnalyzersPackagePath)dotnet/cs/" />
165170

166171
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
167172
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />

src/Framework/Analyzer/src/DelegateEndpoints/DetectMismatchedParameterOptionality.cs renamed to src/Framework/AspNetCoreAnalyzers/src/Analyzers/DetectMismatchedParameterOptionality.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static void DetectMismatchedParameterOptionality(
5050
continue;
5151
}
5252
var argumentIsOptional = parameter.IsOptional || parameter.NullableAnnotation != NullableAnnotation.NotAnnotated;
53-
var location = parameter.DeclaringSyntaxReferences.SingleOrDefault()?.GetSyntax().GetLocation();
53+
var location = parameter.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation();
5454
var routeParamIsOptional = enumerator.CurrentQualifiers.IndexOf('?') > -1;
5555

5656
if (!argumentIsOptional && routeParamIsOptional)

src/Framework/Analyzer/src/Microsoft.AspNetCore.App.Analyzers.csproj renamed to src/Framework/AspNetCoreAnalyzers/src/Analyzers/Microsoft.AspNetCore.App.Analyzers.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="All" />
1414

1515
<InternalsVisibleTo Include="Microsoft.AspNetCore.App.Analyzers.Test" />
16+
<InternalsVisibleTo Include="Microsoft.AspNetCore.App.CodeFixes" />
1617
</ItemGroup>
1718

1819
<ItemGroup>

0 commit comments

Comments
 (0)