-
Notifications
You must be signed in to change notification settings - Fork 480
Open
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzersPerformanceIndicates a performance problemIndicates a performance problem
Description
In a binlog I was looking at, noticed:
It might be caused by SemanticModel usage below?
Lines 18 to 31 in 44af587
| context.RegisterSyntaxNodeAction(context => | |
| { | |
| var usingDirective = (UsingDirectiveSyntax)context.Node; | |
| if (usingDirective.Alias != null && | |
| usingDirective.DescendantNodes().OfType<GenericNameSyntax>().Any() && | |
| context.SemanticModel.GetDeclaredSymbol(usingDirective) is IAliasSymbol aliasSymbol && | |
| aliasSymbol.Target is INamedTypeSymbol namedTypeSymbol && | |
| namedTypeSymbol.IsGenericType) | |
| { | |
| var generics = namedTypeSymbol.TypeParameters.Zip(namedTypeSymbol.TypeArguments, (parameter, argument) => (parameter, argument)); | |
| ProcessGenericTypes(generics, instantiatedTypes); | |
| } | |
| }, SyntaxKind.UsingDirective); |
Can this be improved?
mavasani
Metadata
Metadata
Assignees
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzersPerformanceIndicates a performance problemIndicates a performance problem
