Skip to content

Commit b9f8bfd

Browse files
Reapply "Update to using unbound nameof(X<>) expressions (dotnet#78731)"
This reverts commit cddbe0b.
1 parent 0256a95 commit b9f8bfd

File tree

30 files changed

+66
-66
lines changed

30 files changed

+66
-66
lines changed

src/Analyzers/CSharp/Analyzers/UseCollectionExpression/CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal sealed partial class CSharpUseCollectionExpressionForBuilderDiagnosticA
2727
EnforceOnBuildValues.UseCollectionExpressionForBuilder)
2828
{
2929
private const string CreateBuilderName = nameof(ImmutableArray.CreateBuilder);
30-
private const string GetInstanceName = nameof(ArrayBuilder<int>.GetInstance);
30+
private const string GetInstanceName = nameof(ArrayBuilder<>.GetInstance);
3131

3232
protected override void InitializeWorker(CodeBlockStartAnalysisContext<SyntaxKind> context, INamedTypeSymbol? expressionType)
3333
=> context.RegisterSyntaxNodeAction(context => AnalyzeInvocationExpression(context, expressionType), SyntaxKind.InvocationExpression);
@@ -117,7 +117,7 @@ void FadeOutCode(SyntaxNodeAnalysisContext context, AnalysisResult analysisResul
117117
return null;
118118

119119
if (memberAccessExpression.Name.Identifier.ValueText == GetInstanceName &&
120-
memberAccessExpression.Expression is not GenericNameSyntax { Identifier.ValueText: nameof(ArrayBuilder<int>) })
120+
memberAccessExpression.Expression is not GenericNameSyntax { Identifier.ValueText: nameof(ArrayBuilder<>) })
121121
{
122122
return null;
123123
}
@@ -217,12 +217,12 @@ identifierName.Parent is MemberAccessExpressionSyntax(SyntaxKind.SimpleMemberAcc
217217
memberAccess.Expression == identifierName &&
218218
memberAccess.Parent is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 0 } invocationExpression &&
219219
memberAccess.Name.Identifier.ValueText
220-
is nameof(ImmutableArray<int>.Builder.ToImmutable)
221-
or nameof(ImmutableArray<int>.Builder.MoveToImmutable)
222-
or nameof(ImmutableArray<int>.Builder.ToArray)
223-
or nameof(ArrayBuilder<int>.ToImmutableAndClear)
224-
or nameof(ArrayBuilder<int>.ToImmutableAndFree)
225-
or nameof(ArrayBuilder<int>.ToArrayAndFree)
220+
is nameof(ImmutableArray<>.Builder.ToImmutable)
221+
or nameof(ImmutableArray<>.Builder.MoveToImmutable)
222+
or nameof(ImmutableArray<>.Builder.ToArray)
223+
or nameof(ArrayBuilder<>.ToImmutableAndClear)
224+
or nameof(ArrayBuilder<>.ToImmutableAndFree)
225+
or nameof(ArrayBuilder<>.ToArrayAndFree)
226226
or nameof(Enumerable.ToList))
227227
{
228228
return invocationExpression;

src/Analyzers/CSharp/Analyzers/UseCollectionExpression/CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,24 @@ internal sealed partial class CSharpUseCollectionExpressionForFluentDiagnosticAn
4242
private static readonly ImmutableArray<string> s_suffixes =
4343
[
4444
nameof(Array),
45-
nameof(Span<int>),
46-
nameof(ReadOnlySpan<int>),
47-
nameof(System.Collections.Generic.List<int>),
48-
nameof(HashSet<int>),
49-
nameof(LinkedList<int>),
50-
nameof(Queue<int>),
51-
nameof(SortedSet<int>),
52-
nameof(Stack<int>),
53-
nameof(ICollection<int>),
54-
nameof(IReadOnlyCollection<int>),
55-
nameof(IList<int>),
56-
nameof(IReadOnlyList<int>),
57-
nameof(ImmutableArray<int>),
58-
nameof(ImmutableHashSet<int>),
59-
nameof(ImmutableList<int>),
60-
nameof(ImmutableQueue<int>),
61-
nameof(ImmutableSortedSet<int>),
62-
nameof(ImmutableStack<int>),
45+
nameof(Span<>),
46+
nameof(ReadOnlySpan<>),
47+
nameof(System.Collections.Generic.List<>),
48+
nameof(HashSet<>),
49+
nameof(LinkedList<>),
50+
nameof(Queue<>),
51+
nameof(SortedSet<>),
52+
nameof(Stack<>),
53+
nameof(ICollection<>),
54+
nameof(IReadOnlyCollection<>),
55+
nameof(IList<>),
56+
nameof(IReadOnlyList<>),
57+
nameof(ImmutableArray<>),
58+
nameof(ImmutableHashSet<>),
59+
nameof(ImmutableList<>),
60+
nameof(ImmutableQueue<>),
61+
nameof(ImmutableSortedSet<>),
62+
nameof(ImmutableStack<>),
6363
nameof(System.Collections.Immutable),
6464
];
6565

src/Analyzers/CSharp/Analyzers/UseCollectionExpression/CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private void AnalyzeBaseObjectCreationExpression(
5353

5454
var symbol = semanticModel.GetSymbolInfo(objectCreationExpression, cancellationToken).Symbol;
5555
if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, Parameters: [var constructorParameter] } ||
56-
constructorParameter.Type.Name != nameof(IEnumerable<int>))
56+
constructorParameter.Type.Name != nameof(IEnumerable<>))
5757
{
5858
return;
5959
}

src/Analyzers/CSharp/Analyzers/UseCollectionExpression/UseCollectionExpressionHelpers.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ bool IsSafeConversionWhenTypesDoNotMatch(out bool changesSemantics)
193193
var convertedType = originalTypeInfo.ConvertedType;
194194

195195
var convertedToReadOnlySpan =
196-
convertedType.Name == nameof(ReadOnlySpan<int>) &&
196+
convertedType.Name == nameof(ReadOnlySpan<>) &&
197197
convertedType.OriginalDefinition.Equals(compilation.ReadOnlySpanOfTType());
198198

199199
var convertedToSpan =
200-
convertedType.Name == nameof(Span<int>) &&
200+
convertedType.Name == nameof(Span<>) &&
201201
convertedType.OriginalDefinition.Equals(compilation.SpanOfTType());
202202

203203
// ReadOnlySpan<X> x = stackalloc[] ...
@@ -206,7 +206,7 @@ bool IsSafeConversionWhenTypesDoNotMatch(out bool changesSemantics)
206206
// restrictive than Span<X>
207207
var isSpanToReadOnlySpan =
208208
convertedToReadOnlySpan &&
209-
type.Name == nameof(Span<int>) &&
209+
type.Name == nameof(Span<>) &&
210210
type.OriginalDefinition.Equals(compilation.SpanOfTType()) &&
211211
convertedType.GetTypeArguments()[0].Equals(type.GetTypeArguments()[0]);
212212
if (isSpanToReadOnlySpan)
@@ -264,7 +264,7 @@ bool IsSafeConversionWhenTypesDoNotMatch(out bool changesSemantics)
264264
// disallow converting those types to ensure semantics are preserved. We do this even though
265265
// allowSemanticsChange is true because this will basically be certain to break semantics, as opposed to
266266
// the more common case where semantics may change slightly, but likely not in a way that breaks code.
267-
if (type.Name is nameof(ObservableCollection<int>) or nameof(ReadOnlyObservableCollection<int>))
267+
if (type.Name is nameof(ObservableCollection<>) or nameof(ReadOnlyObservableCollection<>))
268268
return false;
269269

270270
// If the original expression was creating a set, but is being assigned to one of the well known
@@ -933,7 +933,7 @@ bool IsCompatibleSignatureAndArguments(
933933
{
934934
Type: INamedTypeSymbol
935935
{
936-
Name: nameof(IEnumerable<int>),
936+
Name: nameof(IEnumerable<>),
937937
TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }]
938938
} enumerableType
939939
}] &&
@@ -980,7 +980,7 @@ originalCreateMethod.Parameters is [
980980
{
981981
Type: INamedTypeSymbol
982982
{
983-
Name: nameof(Span<int>) or nameof(ReadOnlySpan<int>),
983+
Name: nameof(Span<>) or nameof(ReadOnlySpan<>),
984984
TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }]
985985
} spanType
986986
}])

src/Analyzers/CSharp/Analyzers/UseIndexOrRangeOperator/CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private MemberInfo ComputeMemberInfo(IMethodSymbol sliceLikeMethod, bool require
158158
// Also, look to see if the type has a `.Slice(int start, int length)` method.
159159
// This is also a method the compiler knows to look for when a user writes `x[a..b]`
160160
var actualSliceMethod =
161-
sliceLikeMethod.ContainingType.GetMembers(nameof(Span<int>.Slice))
161+
sliceLikeMethod.ContainingType.GetMembers(nameof(Span<>.Slice))
162162
.OfType<IMethodSymbol>()
163163
.FirstOrDefault(s => IsTwoArgumentSliceLikeMethod(s));
164164
if (actualSliceMethod != null)

src/Analyzers/CSharp/CodeFixes/MakeMethodAsynchronous/CSharpMakeMethodAsynchronousCodeFixProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ private static TypeSyntax FixMethodReturnType(
131131
if (IsIEnumerable(returnType, knownTypes) && IsIterator(methodSymbol, cancellationToken))
132132
{
133133
newReturnType = knownTypes.IAsyncEnumerableOfTType is null
134-
? MakeGenericType(nameof(IAsyncEnumerable<int>), methodSymbol.ReturnType)
134+
? MakeGenericType(nameof(IAsyncEnumerable<>), methodSymbol.ReturnType)
135135
: knownTypes.IAsyncEnumerableOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax();
136136
}
137137
else if (IsIEnumerator(returnType, knownTypes) && IsIterator(methodSymbol, cancellationToken))
138138
{
139139
newReturnType = knownTypes.IAsyncEnumeratorOfTType is null
140-
? MakeGenericType(nameof(IAsyncEnumerator<int>), methodSymbol.ReturnType)
140+
? MakeGenericType(nameof(IAsyncEnumerator<>), methodSymbol.ReturnType)
141141
: knownTypes.IAsyncEnumeratorOfTType.Construct(methodSymbol.ReturnType.GetTypeArguments()[0]).GenerateTypeSyntax();
142142
}
143143
else if (IsIAsyncEnumerableOrEnumerator(returnType, knownTypes))

src/Analyzers/CSharp/CodeFixes/UseUtf8StringLiteral/UseUtf8StringLiteralCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private static ExpressionSyntax CreateUtf8String(SyntaxTriviaList leadingTrivia,
206206
MemberAccessExpression(
207207
SyntaxKind.SimpleMemberAccessExpression,
208208
stringLiteral,
209-
IdentifierName(nameof(ReadOnlySpan<byte>.ToArray))))
209+
IdentifierName(nameof(ReadOnlySpan<>.ToArray))))
210210
.WithTrailingTrivia(trailingTrivia);
211211
}
212212
}

src/Analyzers/Core/Analyzers/UseCoalesceExpression/AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
8080
syntaxFacts.GetPartsOfMemberAccessExpression(conditionMemberAccess, out var conditionExpression, out var conditionSimpleName);
8181
syntaxFacts.GetNameAndArityOfSimpleName(conditionSimpleName, out var conditionName, out _);
8282

83-
if (conditionName != nameof(Nullable<int>.HasValue))
83+
if (conditionName != nameof(Nullable<>.HasValue))
8484
return;
8585

8686
var whenPartToCheck = notHasValueExpression ? whenFalseNodeLow : whenTrueNodeLow;
@@ -90,7 +90,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
9090
syntaxFacts.GetPartsOfMemberAccessExpression(whenPartMemberAccess, out var whenPartExpression, out var whenPartSimpleName);
9191
syntaxFacts.GetNameAndArityOfSimpleName(whenPartSimpleName, out var whenPartName, out _);
9292

93-
if (whenPartName != nameof(Nullable<int>.Value))
93+
if (whenPartName != nameof(Nullable<>.Value))
9494
return;
9595

9696
if (!syntaxFacts.AreEquivalent(conditionExpression, whenPartExpression))

src/Analyzers/Core/Analyzers/UseCollectionInitializer/UpdateExpressionState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal readonly struct UpdateExpressionState<
2626
{
2727
private static readonly ImmutableArray<(string name, bool isLinq)> s_multiAddNames =
2828
[
29-
(nameof(List<int>.AddRange), isLinq: false),
29+
(nameof(List<>.AddRange), isLinq: false),
3030
(nameof(Enumerable.Concat), isLinq: true),
3131
(nameof(Enumerable.Append), isLinq: true),
3232
];

src/Analyzers/Core/Analyzers/UseNullPropagation/AbstractUseNullPropagationDiagnosticAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static class UseNullPropagationHelpers
2222
public static bool IsSystemNullableValueProperty([NotNullWhen(true)] ISymbol? symbol)
2323
=> symbol is
2424
{
25-
Name: nameof(Nullable<int>.Value),
25+
Name: nameof(Nullable<>.Value),
2626
ContainingType.OriginalDefinition.SpecialType: SpecialType.System_Nullable_T,
2727
};
2828
}

src/Analyzers/Core/CodeFixes/ForEachCast/AbstractForEachCastCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
2929
{
3030
if (context.Diagnostics.First().Properties.ContainsKey(ForEachCastHelpers.IsFixable))
3131
{
32-
RegisterCodeFix(context, AnalyzersResources.Add_explicit_cast, nameof(AbstractForEachCastCodeFixProvider<SyntaxNode>));
32+
RegisterCodeFix(context, AnalyzersResources.Add_explicit_cast, nameof(AbstractForEachCastCodeFixProvider<>));
3333
}
3434

3535
return Task.CompletedTask;

src/Analyzers/Core/CodeFixes/GenerateParameterizedMember/AbstractGenerateMethodService.State.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private bool TryInitializeSimpleName(
167167
{
168168
// If we inferred Func/Action here, attempt to create better parameter names than the default
169169
// 'arg1/arg2/arg3' form that the delegate specifies.
170-
var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<int>), ContainingNamespace.Name: nameof(System) }
170+
var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<>), ContainingNamespace.Name: nameof(System) }
171171
? GenerateParameterNamesBasedOnParameterTypes(delegateInvokeMethod.Parameters)
172172
: delegateInvokeMethod.Parameters.SelectAsArray(p => p.Name);
173173

src/Analyzers/Core/CodeFixes/UseNullPropagation/AbstractUseNullPropagationCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ private void FixIfStatement(
243243
syntaxFacts.GetNameAndArityOfSimpleName(nameNode, out var name, out var arity);
244244
var comparer = syntaxFacts.StringComparer;
245245

246-
if (arity == 0 && comparer.Equals(name, nameof(Nullable<int>.Value)))
246+
if (arity == 0 && comparer.Equals(name, nameof(Nullable<>.Value)))
247247
{
248248
// They're calling ".Value" off of a nullable. Because we're moving to ?.
249249
// we want to remove the .Value as well. i.e. we should generate:

src/EditorFeatures/Core/Lightup/ISmartRenameSessionWrapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ static ISmartRenameSessionWrapper()
6363
defaultValue: SpecializedTasks.Null<object>());
6464

6565
s_renameContextImmutableListBuilderAddAccessor = LightupHelpers.CreateActionAccessor<object, object>(typeof(ImmutableArray<>.Builder).MakeGenericType(s_wrappedRenameContextType),
66-
nameof(ImmutableArray<object>.Builder.Add),
66+
nameof(ImmutableArray<>.Builder.Add),
6767
s_wrappedRenameContextType);
6868
s_renameContextImmutableListBuilderToArrayAccessor = LightupHelpers.CreateFunctionAccessor<object, object>(typeof(ImmutableArray<>.Builder).MakeGenericType(s_wrappedRenameContextType),
69-
nameof(ImmutableArray<object>.Builder.ToImmutable),
69+
nameof(ImmutableArray<>.Builder.ToImmutable),
7070
typeof(ImmutableArray<>).MakeGenericType(s_wrappedRenameContextType));
7171

7272
var immutableArrayOfRenameContextType = typeof(ImmutableArray<>).MakeGenericType(s_wrappedRenameContextType);

src/EditorFeatures/TestUtilities/Diagnostics/DiagnosticTaggerWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public AbstractDiagnosticsTaggerProvider<TTag> TaggerProvider
5555
{
5656
if (_taggerProvider == null)
5757
{
58-
WpfTestRunner.RequireWpfFact($"{nameof(DiagnosticTaggerWrapper<TProvider, TTag>)}.{nameof(TaggerProvider)} creates asynchronous taggers");
58+
WpfTestRunner.RequireWpfFact($"{nameof(DiagnosticTaggerWrapper<,>)}.{nameof(TaggerProvider)} creates asynchronous taggers");
5959

6060
if (typeof(TProvider) == typeof(InlineDiagnosticsTaggerProvider))
6161
{

src/Features/CSharp/Portable/ConvertLinq/ConvertForEachToLinqQuery/ToToListConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ protected override StatementSyntax CreateDefaultStatement(ExpressionSyntax query
4949
SyntaxFactory.MemberAccessExpression(
5050
SyntaxKind.SimpleMemberAccessExpression,
5151
expression,
52-
SyntaxFactory.IdentifierName(nameof(List<object>.AddRange))),
52+
SyntaxFactory.IdentifierName(nameof(List<>.AddRange))),
5353
SyntaxFactory.ArgumentList([SyntaxFactory.Argument(queryOrLinqInvocationExpression)])));
5454
}

src/Features/Core/Portable/GenerateComparisonOperators/GenerateComparisonOperatorsCodeRefactoringProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
119119

120120
private static IMethodSymbol? TryGetCompareMethodImpl(INamedTypeSymbol containingType, ITypeSymbol comparableType)
121121
{
122-
foreach (var member in comparableType.GetMembers(nameof(IComparable<int>.CompareTo)))
122+
foreach (var member in comparableType.GetMembers(nameof(IComparable<>.CompareTo)))
123123
{
124124
if (member is IMethodSymbol method)
125125
return (IMethodSymbol?)containingType.FindImplementationForInterfaceMember(method);

src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/MethodHandlerDetails.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ private static (string name, IEnumerable<string> languages) GetRequestHandlerMet
115115

116116
static LanguageServerEndpointAttribute? GetMethodAttributeFromHandlerMethod(Type handlerType, Type? requestType, Type contextType, Type? responseType)
117117
{
118-
const string HandleRequestName = nameof(IRequestHandler<object, object, object>.HandleRequestAsync);
118+
const string HandleRequestName = nameof(IRequestHandler<,,>.HandleRequestAsync);
119119
const string HandleRequestSuffix = "." + HandleRequestName;
120-
const string HandleNotificationName = nameof(INotificationHandler<object, object>.HandleNotificationAsync);
120+
const string HandleNotificationName = nameof(INotificationHandler<,>.HandleNotificationAsync);
121121
const string HandleNotificationSuffix = "." + HandleNotificationName;
122122

123123
foreach (var methodInfo in handlerType.GetRuntimeMethods())

src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/RequestExecutionQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace Microsoft.CommonLanguageServerProtocol.Framework;
5555
internal class RequestExecutionQueue<TRequestContext> : IRequestExecutionQueue<TRequestContext>
5656
{
5757
private static readonly MethodInfo s_processQueueCoreAsync = typeof(RequestExecutionQueue<TRequestContext>)
58-
.GetMethod(nameof(RequestExecutionQueue<TRequestContext>.ProcessQueueCoreAsync), BindingFlags.NonPublic | BindingFlags.Instance)!;
58+
.GetMethod(nameof(RequestExecutionQueue<>.ProcessQueueCoreAsync), BindingFlags.NonPublic | BindingFlags.Instance)!;
5959

6060
protected readonly ILspLogger _logger;
6161
protected readonly AbstractHandlerProvider _handlerProvider;

src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/Core/MetaAnalyzers/Helpers/DiagnosticWellKnownNames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal static class DiagnosticWellKnownNames
1111
internal const string RegisterSyntaxNodeActionName = nameof(AnalysisContext.RegisterSyntaxNodeAction);
1212
internal const string RegisterSymbolActionName = nameof(AnalysisContext.RegisterSymbolAction);
1313
internal const string RegisterCodeBlockStartActionName = nameof(AnalysisContext.RegisterCodeBlockStartAction);
14-
internal const string RegisterCodeBlockEndActionName = nameof(CodeBlockStartAnalysisContext<int>.RegisterCodeBlockEndAction);
14+
internal const string RegisterCodeBlockEndActionName = nameof(CodeBlockStartAnalysisContext<>.RegisterCodeBlockEndAction);
1515
internal const string RegisterCodeBlockActionName = nameof(AnalysisContext.RegisterCodeBlockAction);
1616
internal const string RegisterOperationBlockStartActionName = nameof(AnalysisContext.RegisterOperationBlockStartAction);
1717
internal const string RegisterOperationBlockEndActionName = nameof(OperationBlockStartAnalysisContext.RegisterOperationBlockEndAction);

src/RoslynAnalyzers/Roslyn.Diagnostics.Analyzers/Core/AbstractApplyTraitToClass`1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
6161
CodeAction.Create(
6262
RoslynDiagnosticsAnalyzersResources.ApplyTraitToContainingType,
6363
cancellationToken => ApplyTraitToClassAsync(state, cancellationToken),
64-
nameof(AbstractApplyTraitToClass<TAttributeSyntax>)));
64+
nameof(AbstractApplyTraitToClass<>)));
6565
}
6666

6767
private async Task<Document> ApplyTraitToClassAsync(State state, CancellationToken cancellationToken)

0 commit comments

Comments
 (0)