Skip to content

Commit 7477d54

Browse files
committed
Address feedback
1 parent 3bc89cd commit 7477d54

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Framework/AspNetCoreAnalyzers/src/SourceGenerators/PublicTopLevelProgramGenerator.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
1919
{
2020
var internalGeneratedProgramClass = context.CompilationProvider
2121
// Get the entry point associated with the compilation, this maps to the Main method definition
22-
.Select((compilation, cancellationToken) => compilation.GetEntryPoint(cancellationToken))
22+
.Select(static (compilation, cancellationToken) => compilation.GetEntryPoint(cancellationToken))
2323
// Get the containing symbol of the entry point, this maps to the Program class
24-
.Select((symbol, _) => symbol?.ContainingSymbol)
24+
.Select(static (symbol, _) => symbol?.ContainingSymbol)
2525
// If the program class is already public, we don't need to generate anything.
26-
.Select((symbol, _) => symbol?.DeclaredAccessibility == Accessibility.Public ? null : symbol)
26+
.Select(static (symbol, _) => symbol?.DeclaredAccessibility == Accessibility.Public ? null : symbol)
2727
// If the discovered `Program` type is not a class then its not
2828
// generated and has been defined in source, so we can skip it
29-
.Select((symbol, _) => symbol is INamedTypeSymbol { TypeKind: TypeKind.Class } ? symbol : null)
29+
.Select(static (symbol, _) => symbol is INamedTypeSymbol { TypeKind: TypeKind.Class } ? symbol : null)
3030
// If there are multiple partial declarations, then do nothing since we don't want
3131
// to trample on visibility explicitly set by the user
32-
.Select((symbol, _) => symbol is { DeclaringSyntaxReferences: { Length: 1 } declaringSyntaxReferences } ? declaringSyntaxReferences.Single() : null)
32+
.Select(static (symbol, _) => symbol is { DeclaringSyntaxReferences: { Length: 1 } declaringSyntaxReferences } ? declaringSyntaxReferences.Single() : null)
3333
// If the `Program` class is already declared in user code, we don't need to generate anything.
34-
.Select((declaringSyntaxReference, cancellationToken) => declaringSyntaxReference?.GetSyntax(cancellationToken) is ClassDeclarationSyntax ? null : declaringSyntaxReference);
34+
.Select(static (declaringSyntaxReference, cancellationToken) => declaringSyntaxReference?.GetSyntax(cancellationToken) is ClassDeclarationSyntax ? null : declaringSyntaxReference);
3535

3636
context.RegisterSourceOutput(internalGeneratedProgramClass, (context, result) =>
3737
{

src/Framework/Framework.slnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"src\\Framework\\AspNetCoreAnalyzers\\samples\\WebAppSample\\WebAppSample.csproj",
2727
"src\\Framework\\AspNetCoreAnalyzers\\src\\Analyzers\\Microsoft.AspNetCore.App.Analyzers.csproj",
2828
"src\\Framework\\AspNetCoreAnalyzers\\src\\CodeFixes\\Microsoft.AspNetCore.App.CodeFixes.csproj",
29+
"src\\Framework\\AspNetCoreAnalyzers\\src\\SourceGenerators\\Microsoft.AspNetCore.App.SourceGenerators.csproj",
2930
"src\\Framework\\AspNetCoreAnalyzers\\test\\Microsoft.AspNetCore.App.Analyzers.Test.csproj",
3031
"src\\Framework\\test\\Microsoft.AspNetCore.App.UnitTests.csproj",
3132
"src\\HealthChecks\\Abstractions\\src\\Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj",

0 commit comments

Comments
 (0)