5 implementations of MethodKind
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationAbstractMethodSymbol.cs (1)
77public virtual MethodKind MethodKind => MethodKind.Ordinary;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
32MethodKind IMethodSymbol.MethodKind
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
56public MethodKind MethodKind => _symbol.MethodKind;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
904Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationAbstractMethodSymbol.cs (1)
77public virtual MethodKind MethodKind => MethodKind.Ordinary;
427 references to MethodKind
Microsoft.CodeAnalysis (10)
CodeGen\CompilationTestData.cs (1)
128var format = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ?
Compilation\Compilation.cs (2)
1507/// Creates an <see cref="IMethodSymbol"/> whose <see cref="IMethodSymbol.MethodKind"/> is <see 1535/// Creates an <see cref="IMethodSymbol"/> whose <see cref="IMethodSymbol.MethodKind"/> is <see
Operations\ControlFlowGraph.cs (1)
57Debug.Assert(method.MethodKind == MethodKind.LocalFunction);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (2)
98Debug.Assert(symbol.MethodKind == MethodKind.LocalFunction); 117Debug.Assert(others.All(((IMethodSymbol m, ILocalFunctionOperation _) tuple) => tuple.m.MethodKind == MethodKind.LocalFunction));
Symbols\IMethodSymbol.cs (3)
223/// Modifier types that are considered part of the calling convention of this method, if the <see cref="MethodKind"/> is <see cref="MethodKind.FunctionPointerSignature"/> 233/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.PropertyGet"/> or <see cref="MethodKind.PropertySet"/>, 235/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.EventAdd"/> or <see cref="MethodKind.EventRemove"/>,
Symbols\ISymbolExtensions.cs (1)
17if (method.MethodKind != MethodKind.ReducedExtension)
Microsoft.CodeAnalysis.CodeStyle (44)
AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
155return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
621switch (methodSymbol.MethodKind)
AbstractSpeculationAnalyzer.cs (3)
374if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 839((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
AccessibilityExtensions.cs (1)
37switch (((IMethodSymbol)currentSymbol).MethodKind)
DeserializationConstructorCheck.cs (1)
26methodSymbol.MethodKind == MethodKind.Constructor &&
IMethodSymbolExtensions.cs (1)
49if (symbol.MethodKind == MethodKind.BuiltinOperator)
INamedTypeSymbolExtensions.cs (3)
233if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 416where m.Kind != SymbolKind.Method || ((IMethodSymbol)m).MethodKind is MethodKind.Ordinary or MethodKind.UserDefinedOperator or MethodKind.Conversion 572IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true,
IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
ISymbolExtensions.cs (13)
138if (methodSymbol.MethodKind is MethodKind.Ordinary or 178=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 205=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 214=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 223=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 226=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 229=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 232=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 238=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 241=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 549=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 552=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
ISymbolExtensions_Accessibility.cs (3)
154((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && 163Debug.Assert(!(symbol.IsKind(SymbolKind.Method) && ((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && symbol.ContainingSymbol.IsKind(SymbolKind.FunctionPointerType))); 165((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator &&
NamingStyleRules.cs (1)
54return method.MethodKind is MethodKind.Ordinary or
SymbolEquivalenceComparer.cs (2)
184if (x.MethodKind == MethodKind.DelegateInvoke && 190else if (x.MethodKind == MethodKind.FunctionPointerSignature)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
173if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 178if (x.MethodKind == MethodKind.ReducedExtension) 197if (x.MethodKind is MethodKind.AnonymousFunction or
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
SymbolKey.cs (1)
326IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
SymbolKey.SymbolKeyWriter.cs (1)
368switch (methodSymbol.MethodKind)
SymbolSpecification.cs (1)
401SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
SymbolUsageAnalysis.Walker.cs (1)
296switch (operation.TargetMethod.MethodKind)
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
AbstractAddParameterCodeFixProvider.cs (1)
128var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
AddParameterService.cs (1)
132if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
CodeGenerationSymbolFactory.cs (2)
377methodKind: accessor.MethodKind, 538methodKind: method.MethodKind,
Microsoft.CodeAnalysis.CSharp (14)
CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplayVisitor.cs (1)
330return ((IMethodSymbol)symbol).MethodKind == MethodKind.LocalFunction;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (12)
273if (symbol.MethodKind == MethodKind.AnonymousFunction) 289else if (symbol.MethodKind == MethodKind.FunctionPointerSignature) 297if (symbol.MethodKind == MethodKind.ReducedExtension && format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.StaticMethod) 301else if (symbol.MethodKind != MethodKind.ReducedExtension && format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.InstanceMethod) 325switch (symbol.MethodKind) 388if (symbol.MethodKind == MethodKind.LocalFunction) 393else if (symbol.MethodKind == MethodKind.ReducedExtension) 423switch (symbol.MethodKind) 451AddKeyword(symbol.MethodKind == MethodKind.PropertyGet ? SyntaxKind.GetKeyword : 466AddKeyword(symbol.MethodKind == MethodKind.EventAdd ? SyntaxKind.AddKeyword : SyntaxKind.RemoveKeyword); 574throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind); 784hasThisParameter: symbol.IsExtensionMethod && symbol.MethodKind != MethodKind.ReducedExtension,
Microsoft.CodeAnalysis.CSharp.CodeStyle (14)
CastSimplifier.cs (4)
812if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1028method.MethodKind is not (MethodKind.LocalFunction or MethodKind.LambdaMethod) && 1198if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1199rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
81if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
74MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet,
CSharpSemanticFacts.cs (1)
65if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
Helpers.cs (3)
70(method.MethodKind == MethodKind.PropertyGet || method.MethodKind == MethodKind.Ordinary) && 143=> method.MethodKind != MethodKind.Ordinary
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
CSharpCodeGenerationService.cs (2)
158if (method.MethodKind == MethodKind.Conversion) 164if (method.MethodKind == MethodKind.UserDefinedOperator)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
2008while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
14347Assert.Equal(MethodKind.ReducedExtension, m6Method.MethodKind);
Microsoft.CodeAnalysis.CSharp.Features (19)
ChangeSignature\CSharpChangeSignatureService.cs (1)
416symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension },
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (1)
55switch (symbol.MethodKind)
CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
81if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
74MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet,
CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (5)
195return (member as IMethodSymbol)?.MethodKind == MethodKind.Constructor; 1944=> symbol.MethodKind switch 2503IMethodSymbol { MethodKind: MethodKind.Destructor } 2507IMethodSymbol { MethodKind: MethodKind.Conversion or MethodKind.UserDefinedOperator } 3103if (container is IMethodSymbol { IsImplicitlyDeclared: false, MethodKind: MethodKind.Constructor })
InlineHints\CSharpInlineTypeHintsService.cs (1)
82if (parameter?.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } &&
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (3)
70(method.MethodKind == MethodKind.PropertyGet || method.MethodKind == MethodKind.Ordinary) && 143=> method.MethodKind != MethodKind.Ordinary
NavigationBar\CSharpNavigationBarItemService.cs (1)
180return method.MethodKind is MethodKind.PropertyGet or MethodKind.PropertySet;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
65if (invokeMethod.MethodKind == MethodKind.FunctionPointerSignature)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
75methodGroup = methodGroup.Where(m => m.IsStatic || m is IMethodSymbol { MethodKind: MethodKind.LocalFunction });
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\DelegateTypeTests.cs (3)
902Assert.Equal(MethodKind.LambdaMethod, method.MethodKind); 945Assert.Equal(MethodKind.LambdaMethod, method.MethodKind); 5343Assert.Equal(MethodKind.LambdaMethod, method.MethodKind);
Semantics\LambdaTests.cs (5)
854Assert.Equal(MethodKind.AnonymousFunction, (sym as IMethodSymbol).MethodKind); 864Assert.Equal(MethodKind.AnonymousFunction, (sym as IMethodSymbol).MethodKind); 3040Assert.Equal(MethodKind.AnonymousFunction, lambda.MethodKind); 3047Assert.Equal(MethodKind.AnonymousFunction, lambda.MethodKind); 5606Assert.Equal(MethodKind.LambdaMethod, method.MethodKind);
Semantics\LocalFunctionTests.cs (1)
1063Assert.Equal(MethodKind.Constructor, attrConstructor.MethodKind);
Semantics\NativeIntegerTests.cs (2)
325switch (method.MethodKind) 345return !(nativeIntegerMember is IMethodSymbol { MethodKind: MethodKind.Constructor });
Semantics\OperatorTests.cs (3)
7617Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind); 8290Assert.Equal(MethodKind.UserDefinedOperator, symbol1.MethodKind); 8393Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind);
Semantics\QueryTests.cs (4)
1462Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1471Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind); 1671Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1680Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind);
Semantics\TopLevelStatementsTests.cs (1)
4209Assert.Equal(MethodKind.LocalFunction, ((IMethodSymbol)local).MethodKind);
Semantics\UnsafeTests.cs (2)
6035Assert.Equal(MethodKind.BuiltinOperator, summaryMethod.MethodKind); 6497Assert.Equal(MethodKind.BuiltinOperator, summaryMethod.MethodKind);
Semantics\Utf8StringsLiteralsTests.cs (1)
4068Assert.Equal(MethodKind.BuiltinOperator, method.MethodKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (46)
Compilation\GetSemanticInfoTests.cs (7)
1074Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1093Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1116Assert.Equal(MethodKind.Constructor, invokedConstructor.MethodKind); 1172Assert.Equal(MethodKind.EventAdd, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 1201Assert.Equal(MethodKind.EventRemove, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2360Assert.Equal(MethodKind.AnonymousFunction, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2542Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)symbol.ContainingSymbol).MethodKind);
Compilation\SemanticModelAPITests.cs (3)
1371Assert.Equal(MethodKind.Constructor, method.MethodKind); 2087Assert.Equal(MethodKind.Constructor, method.MethodKind); 2104Assert.Equal(MethodKind.Constructor, method.MethodKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (10)
354Assert.Equal(MethodKind.PropertyGet, getterSymbol.MethodKind); 360Assert.Equal(MethodKind.PropertySet, setterSymbol.MethodKind); 1722symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 1885symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 2854Assert.Equal(MethodKind.ExplicitInterfaceImplementation, explicitMethodSymbol.MethodKind); 2874Assert.Equal(MethodKind.PropertyGet, explicitPropertyGetterSymbol.MethodKind); 2884Assert.Equal(MethodKind.PropertySet, explicitPropertySetterSymbol.MethodKind); 4435Assert.Equal(MethodKind.Conversion, conversion.MethodKind); 4466Assert.Equal(MethodKind.Conversion, conversion.MethodKind); 4497Assert.Equal(MethodKind.UserDefinedOperator, @operator.MethodKind);
Compilation\SemanticModelGetSemanticInfoTests.cs (5)
4886Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 4893Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 5413Assert.Equal(MethodKind.PropertySet, ((IMethodSymbol)sortedCandidates[0]).MethodKind); 6373Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)symbol).MethodKind); 7295Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol).MethodKind);
DocumentationComments\CrefTests.cs (5)
3230Assert.Equal(MethodKind.Ordinary, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3278Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3302Assert.Equal(MethodKind.UserDefinedOperator, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3326Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 5718Assert.Equal(MethodKind.UserDefinedOperator, ((IMethodSymbol)symbol).MethodKind);
SymbolDisplay\SymbolDisplayTests.cs (4)
6306Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6349Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6384Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6478Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind);
Symbols\ConversionTests.cs (3)
1721var conversionSymbols = destinationType.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Conversion); 1802Assert.Equal(MethodKind.Conversion, method.MethodKind); 1836Assert.Equal(MethodKind.Conversion, method.MethodKind);
Symbols\DestructorTests.cs (1)
401Assert.Equal(MethodKind.Destructor, destructor.MethodKind);
Symbols\ExtensionMethodTests.cs (2)
229Assert.Equal(MethodKind.ReducedExtension, gooSymbol.MethodKind); 232Assert.Equal(MethodKind.Ordinary, gooOriginal.MethodKind);
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
159Assert.Equal(MethodKind.AnonymousFunction, sym.MethodKind); 523if (memb.Kind == SymbolKind.Method && ((IMethodSymbol)memb).MethodKind == MethodKind.Constructor)
Symbols\Source\NullablePublicAPITests.cs (4)
3492Assert.Equal(MethodKind.LambdaMethod, lambdaSymbol.MethodKind); 3545Assert.Equal(MethodKind.LambdaMethod, innerLambdaSymbol.MethodKind); 3606Assert.Equal(MethodKind.LambdaMethod, innerLambdaSymbol.MethodKind); 4135var localFunctionResult = lookupResults.OfType<IMethodSymbol>().First(m => m.MethodKind == MethodKind.LocalFunction);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\LambdaUtilitiesTests.cs (1)
49bool expected = enclosingMethod.MethodKind == MethodKind.LambdaMethod && enclosingSyntax.Span.Contains(span.Value);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
CastSimplifier.cs (4)
812if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1028method.MethodKind is not (MethodKind.LocalFunction or MethodKind.LambdaMethod) && 1198if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1199rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
288if (methodSymbol.MethodKind == MethodKind.Constructor) 296return methodSymbol.MethodKind == MethodKind.ReducedExtension
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
33&& methodSymbol.MethodKind == MethodKind.UserDefinedOperator)
ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
CSharpCodeGenerationService.cs (2)
158if (method.MethodKind == MethodKind.Conversion) 164if (method.MethodKind == MethodKind.UserDefinedOperator)
CSharpSemanticFacts.cs (1)
65if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
2008while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
434if (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction })
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
33if (member is not IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } method)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
2495var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 4174var method = symbolC.GetMembers().OfType<IMethodSymbol>().Single(m => m.MethodKind == MethodKind.Ordinary);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Utilities\SymbolEquivalenceComparerTests.cs (2)
1742Assert.Equal(MethodKind.ReducedExtension, method1.MethodKind); 1745Assert.Equal(MethodKind.ReducedExtension, method2.MethodKind);
Microsoft.CodeAnalysis.Features (50)
AbstractAddParameterCodeFixProvider.cs (1)
128var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
155return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
621switch (methodSymbol.MethodKind)
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
AddParameterService.cs (1)
132if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
ChangeSignature\AbstractChangeSignatureService.cs (3)
273(methodSymbol.MethodKind == MethodKind.PropertyGet || methodSymbol.MethodKind == MethodKind.PropertySet)) 313if (methodSymbol.MethodKind == MethodKind.DelegateInvoke)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
33=> symbol.MethodKind == MethodKind.DelegateInvoke;
CodeLens\CodeLensFindReferenceProgress.cs (1)
134(definition as IMethodSymbol)?.MethodKind == MethodKind.Constructor;
CodeLens\CodeLensReferencesService.cs (1)
237if (method.MethodKind != MethodKind.AnonymousFunction)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
90while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
250method.MethodKind == MethodKind.BuiltinOperator &&
DeserializationConstructorCheck.cs (1)
26methodSymbol.MethodKind == MethodKind.Constructor &&
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
140switch (((IMethodSymbol)symbol).MethodKind)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (12)
360=> symbol.MethodKind switch 3453MethodKind: 3721if (oldMethod.MethodKind != newMethod.MethodKind) 3731else if (oldMethod.MethodKind == MethodKind.Conversion) 3735else if (oldMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation || newMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation) 3842if (oldMethod.MethodKind == MethodKind.DeclareMethod || newMethod.MethodKind == MethodKind.DeclareMethod) 4939Contract.ThrowIfFalse(oldCtor is IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor }); 5530if (containingLambda?.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction) 5918if ((member as IMethodSymbol)?.MethodKind == MethodKind.AnonymousFunction || HasParameterClosureScope(member))
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
179method.MethodKind == MethodKind.Ordinary &&
ExtractMethod\Extensions.cs (1)
51if (methodSymbol?.MethodKind != MethodKind.AnonymousFunction)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
130.Any(m => m.MethodKind == MethodKind.UserDefinedOperator &&
GoToBase\AbstractGoToBaseService.cs (1)
47if (bases.Length == 0 && symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (2)
483return method1.MethodKind == MethodKind.Ordinary && 484method2.MethodKind == MethodKind.Ordinary &&
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
91MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.UserDefinedOperator or MethodKind.Conversion
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
70if (method.MethodKind != MethodKind.Constructor)
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
224if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction } method })
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
81var methodKind = methodSymbol.MethodKind; 156if (methodSymbol.MethodKind is not MethodKind.Constructor) 163if (methodSymbol.MethodKind is not MethodKind.LocalFunction)
LanguageServiceIndexFormat\SymbolMoniker.cs (1)
39if (symbol is IMethodSymbol method && method.MethodKind == MethodKind.BuiltinOperator)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
667var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
56public MethodKind MethodKind => _symbol.MethodKind;
PullMemberUp\MemberAndDestinationValidator.cs (1)
47IMethodSymbol methodSymbol => methodSymbol.MethodKind == MethodKind.Ordinary,
Rename\SymbolicRenameInfo.cs (1)
206if (symbol.Kind == SymbolKind.Method && ((IMethodSymbol)symbol).MethodKind == MethodKind.UserDefinedOperator)
RQName\RQNodeBuilder.cs (3)
200if (symbol.MethodKind is MethodKind.UserDefinedOperator or 212if (symbol.MethodKind == MethodKind.Constructor) 216else if (symbol.MethodKind == MethodKind.Destructor)
Shared\Extensions\ISymbolExtensions_2.cs (3)
98if (methodSymbol.MethodKind is MethodKind.UserDefinedOperator or 105methodSymbol.MethodKind == MethodKind.ReducedExtension) 243switch (method.MethodKind)
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (1)
Generator.cs (1)
469if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
Microsoft.CodeAnalysis.Test.Utilities (7)
Compilation\CompilationExtensions.cs (1)
378if ((parameterInitializerOperation.Parameter.ContainingSymbol as IMethodSymbol)?.MethodKind is not (MethodKind.LocalFunction or MethodKind.AnonymousFunction))
Compilation\ControlFlowGraphVerifier.cs (2)
1741if (method.MethodKind == MethodKind.LocalFunction) 1756if (method.MethodKind == MethodKind.LocalFunction)
Compilation\TestOperationVisitor.cs (1)
792if (method.MethodKind == MethodKind.BuiltinOperator)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
48bool inConstructor = containingMethod.MethodKind == MethodKind.Constructor; 49ITypeSymbol staticConstructorType = containingMethod.MethodKind == MethodKind.StaticConstructor ? containingMethod.ContainingType : null;
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
40MethodKind = symbol is IMethodSymbol ? ((IMethodSymbol)symbol).MethodKind : (MethodKind?)null;
Microsoft.CodeAnalysis.VisualBasic (16)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (13)
170If symbol.MethodKind = MethodKind.ReducedExtension AndAlso format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.StaticMethod Then 172ElseIf symbol.MethodKind <> MethodKind.ReducedExtension AndAlso format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.InstanceMethod Then 196Select Case symbol.MethodKind 233symbol.MethodKind = MethodKind.EventAdd, 236symbol.MethodKind = MethodKind.EventRemove, 284Throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind) 296If symbol.MethodKind = MethodKind.ReducedExtension Then 310Select Case symbol.MethodKind 375Throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind) 383If symbol.MethodKind = MethodKind.BuiltinOperator Then 427AddParametersIfRequired(isExtensionMethod:=method.IsExtensionMethod AndAlso method.MethodKind <> MethodKind.ReducedExtension, 435Select Case method.MethodKind 701DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.AnonymousFunction OrElse
Symbols\MethodSymbol.vb (1)
904Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Symbols\NamedTypeSymbol.vb (2)
413Debug.Assert(method.MethodKind = MethodKind.Constructor) 421Debug.Assert(method.MethodKind = MethodKind.StaticConstructor)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.VisualBasic.Features (10)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
358If methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.ReducedExtension Then
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
164If methodSymbol.MethodKind = MethodKind.PropertyGet Then 166ElseIf methodSymbol.MethodKind = MethodKind.PropertySet Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (3)
1863Select Case symbol.MethodKind 2513If method.MethodKind = MethodKind.Conversion OrElse method.MethodKind = MethodKind.UserDefinedOperator Then
GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
184Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
277Return method.MethodKind = MethodKind.Ordinary OrElse 278method.MethodKind = MethodKind.UserDefinedOperator OrElse 279method.MethodKind = MethodKind.Conversion
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (2)
1152Assert.Equal(MethodKind.Conversion, sym1.MethodKind) 1153Assert.Equal(MethodKind.UserDefinedOperator, sym2.MethodKind)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (6)
SymbolsTests\CheckedUserDefinedOperatorsTests.vb (6)
188Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 193Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind) 375Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 379Assert.Equal(MethodKind.UserDefinedOperator, operators(0).MethodKind) 554Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 558Assert.Equal(MethodKind.Conversion, operators(0).MethodKind)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (11)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
169(symbol.IsKind(SymbolKind.Method) AndAlso DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.Constructor)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
211Select Case methodSymbol.MethodKind
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.vb (1)
29DirectCast(symbolInfo.Symbol, IMethodSymbol).MethodKind = MethodKind.UserDefinedOperator Then
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (1)
124Function(s) If(TryCast(s, IMethodSymbol)?.MethodKind = MethodKind.Ordinary, False))
CodeGeneration\VisualBasicCodeGenerationService.vb (2)
154If method.MethodKind = MethodKind.UserDefinedOperator Then 158If method.MethodKind = MethodKind.Conversion Then
IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
337symbols = symbols.WhereAsArray(Function(s) s.Kind <> SymbolKind.Method OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.UserDefinedOperator) 376If method IsNot Nothing AndAlso method.MethodKind = MethodKind.Constructor Then
Microsoft.CodeAnalysis.Workspaces (74)
AbstractSpeculationAnalyzer.cs (3)
374if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 839((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
AccessibilityExtensions.cs (1)
37switch (((IMethodSymbol)currentSymbol).MethodKind)
CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
CodeGenerationSymbolFactory.cs (2)
377methodKind: accessor.MethodKind, 538methodKind: method.MethodKind,
Editing\SyntaxGenerator.cs (3)
262if (method.MethodKind is not (MethodKind.UserDefinedOperator or MethodKind.Conversion)) 746switch (method.MethodKind) 843switch (method.MethodKind)
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
20=> symbol.MethodKind == MethodKind.Constructor;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
27=> symbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 66result.AddRange(symbol.MethodKind == MethodKind.Constructor
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (1)
16=> symbol.MethodKind == MethodKind.Destructor;
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
20=> symbol is { MethodKind: MethodKind.Conversion, Name: WellKnownMemberNames.ExplicitConversionName or WellKnownMemberNames.ImplicitConversionName } &&
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (1)
16=> symbol.MethodKind == MethodKind.ExplicitInterfaceImplementation;
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (1)
18=> symbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.BuiltinOperator;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
15=> symbol.MethodKind is MethodKind.Ordinary or
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
170if (declaredSymbol is IMethodSymbol { MethodKind: not MethodKind.AnonymousFunction } method) 208if (containingMethod.MethodKind == MethodKind.DelegateInvoke)
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
18=> symbol.MethodKind.IsPropertyAccessor();
FindSymbols\ReferenceLocationExtensions.cs (1)
95if (method.MethodKind != MethodKind.AnonymousFunction)
IMethodSymbolExtensions.cs (1)
49if (symbol.MethodKind == MethodKind.BuiltinOperator)
IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
ISymbolExtensions_Accessibility.cs (3)
154((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && 163Debug.Assert(!(symbol.IsKind(SymbolKind.Method) && ((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && symbol.ContainingSymbol.IsKind(SymbolKind.FunctionPointerType))); 165((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator &&
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (3)
233if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 416where m.Kind != SymbolKind.Method || ((IMethodSymbol)m).MethodKind is MethodKind.Ordinary or MethodKind.UserDefinedOperator or MethodKind.Conversion 572IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (13)
138if (methodSymbol.MethodKind is MethodKind.Ordinary or 178=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 205=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 214=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 223=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 226=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 229=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 232=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 238=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 241=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 549=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 552=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
NamingStyleRules.cs (1)
54return method.MethodKind is MethodKind.Ordinary or
ReassignedVariable\AbstractReassignedVariableService.cs (1)
156if (methodOrProperty is IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet } method)
Recommendations\AbstractRecommendationService.cs (1)
87switch (((IMethodSymbol)symbol).MethodKind)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
68if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } owningMethod)
Rename\RenameUtilities.cs (1)
361if (methodSymbol.MethodKind is MethodKind.Constructor or
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (3)
196if (!method.IsImplicitlyDeclared && (method.MethodKind == MethodKind.Constructor || 197method.MethodKind == MethodKind.StaticConstructor || 198method.MethodKind == MethodKind.Destructor))
Shared\Extensions\ISymbolExtensions.cs (1)
478if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
Shared\Extensions\ISymbolExtensions_2.cs (1)
17if (method.MethodKind is MethodKind.EventAdd or
Shared\Extensions\SemanticModelExtensions.cs (1)
54methodSymbol.MethodKind == MethodKind.BuiltinOperator &&
Shared\Utilities\SignatureComparer.cs (5)
77if ((method1.MethodKind == MethodKind.AnonymousFunction) != 78(method2.MethodKind == MethodKind.AnonymousFunction)) 83if (method1.MethodKind != MethodKind.AnonymousFunction) 89if (method1.MethodKind != method2.MethodKind ||
SymbolEquivalenceComparer.cs (2)
184if (x.MethodKind == MethodKind.DelegateInvoke && 190else if (x.MethodKind == MethodKind.FunctionPointerSignature)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
173if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 178if (x.MethodKind == MethodKind.ReducedExtension) 197if (x.MethodKind is MethodKind.AnonymousFunction or
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
SymbolKey.cs (1)
326IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
SymbolKey.SymbolKeyWriter.cs (1)
368switch (methodSymbol.MethodKind)
SymbolSpecification.cs (1)
401SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
SymbolUsageAnalysis.Walker.cs (1)
296switch (operation.TargetMethod.MethodKind)
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
UtilityTest\DocumentationCommentIdTests.cs (8)
155CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#cctor", compilation, s => s.MethodKind == MethodKind.StaticConstructor); 156CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 0); 157CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor(System.String)", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 1); 174CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.Finalize", compilation, s => s.MethodKind == MethodKind.Destructor); 281CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_UnaryPlus(Acme.Widget)", compilation, m => m.MethodKind == MethodKind.UserDefinedOperator && m.Parameters.Length == 1); 297CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Addition(Acme.Widget,Acme.Widget)", compilation, m => m.MethodKind == MethodKind.UserDefinedOperator && m.Parameters.Length == 2); 314CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Explicit(Acme.Widget)~System.Int32", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int32"); 315CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Implicit(Acme.Widget)~System.Int64", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int64");
Microsoft.VisualStudio.LanguageServices (12)
Implementation\VsRefactorNotifyService.cs (1)
165if (methodSymbol.MethodKind is MethodKind.Constructor or
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
348if (methodSymbol.MethodKind == MethodKind.Destructor || 349methodSymbol.MethodKind == MethodKind.Constructor ||
Library\ObjectBrowser\Lists\MemberListItem.cs (1)
45_kind = methodSymbol.MethodKind is MethodKind.Conversion or
Progression\GraphBuilder.cs (6)
372if (methodSymbol.MethodKind == MethodKind.Constructor) 376else if (methodSymbol.MethodKind == MethodKind.StaticConstructor) 380else if (methodSymbol.MethodKind == MethodKind.Destructor) 506switch (symbol.MethodKind) 610var isOperator = method.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 616node[RoslynGraphProperties.MethodKind] = method.MethodKind;
Progression\GraphNodeIdCreation.cs (1)
320if (member is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Conversion)
Progression\GraphQueries\CallsGraphQuery.cs (1)
56(newSymbol.CanBeReferencedByName || ((IMethodSymbol)newSymbol).MethodKind == MethodKind.Constructor))
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.cs (2)
999if (methodSymbol.MethodKind is MethodKind.PropertyGet or 2192switch (symbol.MethodKind)
LanguageService\CSharpHelpContextService.cs (1)
198if (symbol is IMethodSymbol method && method.MethodKind == MethodKind.BuiltinOperator)
ObjectBrowser\DescriptionBuilder.cs (4)
194if (methodSymbol.MethodKind is not MethodKind.Constructor and 203if (methodSymbol.MethodKind == MethodKind.Conversion) 253methodSymbol.MethodKind == MethodKind.Destructor) 268methodSymbol.MethodKind != MethodKind.StaticConstructor)
Progression\CSharpProgressionLanguageService.cs (1)
133=> f.MethodKind is MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
228methodTypeMock.SetupGet(s => s.MethodKind).Returns(methodKind);
Microsoft.VisualStudio.LanguageServices.Implementation (8)
CodeModel\Collections\ExternalOverloadsCollection.cs (1)
53if (symbol.MethodKind is not MethodKind.Ordinary and
CodeModel\Collections\OverloadsCollection.cs (1)
55if (symbol.MethodKind is not MethodKind.Ordinary and
CodeModel\ExternalElements\ExternalCodeAccessorFunction.cs (3)
31Debug.Assert(symbol.MethodKind is MethodKind.EventAdd or 47var methodKind = MethodSymbol.MethodKind; 89switch (MethodSymbol.MethodKind)
CodeModel\ExternalElements\ExternalCodeFunction.cs (2)
49switch (MethodSymbol.MethodKind) 73if (symbol.MethodKind is not MethodKind.Ordinary and
CodeModel\InternalElements\CodeFunction.cs (1)
122if (symbol.MethodKind is not MethodKind.Ordinary and
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
238Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
301Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
Microsoft.VisualStudio.LanguageServices.VisualBasic (9)
CodeModel\VisualBasicCodeModelService.vb (6)
1387If methodSymbol.MethodKind = MethodKind.PropertyGet OrElse 1388methodSymbol.MethodKind = MethodKind.PropertySet OrElse 1389methodSymbol.MethodKind = MethodKind.EventAdd OrElse 1390methodSymbol.MethodKind = MethodKind.EventRemove OrElse 1391methodSymbol.MethodKind = MethodKind.EventRaise Then 2543Select Case symbol.MethodKind
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
96If methodSymbol.MethodKind = MethodKind.Ordinary AndAlso
ObjectBrowser\DescriptionBuilder.vb (2)
115Select Case methodSymbol.MethodKind 341(methodSymbol Is Nothing OrElse Not methodSymbol.MethodKind = MethodKind.DeclareMethod) AndAlso