10 implementations of Kind
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
79public override SymbolKind Kind => SymbolKind.Method;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
47public override SymbolKind Kind => SymbolKind.NamedType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
78public abstract SymbolKind Kind { get; }
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
98SymbolKind ISymbol.Kind => SymbolKind.Preprocessing;
Symbols\PublicModel\Symbol.cs (1)
195SymbolKind ISymbol.Kind => UnderlyingSymbol.Kind;
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
61public SymbolKind Kind => _symbol.Kind;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1319Private ReadOnly Property ISymbol_Kind As SymbolKind Implements ISymbol.Kind, ISymbolInternal.Kind
Microsoft.CodeAnalysis.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
79public override SymbolKind Kind => SymbolKind.Method;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
47public override SymbolKind Kind => SymbolKind.NamedType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
78public abstract SymbolKind Kind { get; }
1408 references to Kind
ConfigurationSchemaGenerator (2)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
ILLink.RoslynAnalyzer (5)
CompilationExtensions.cs (2)
83 switch (symbol.Kind) { 98 while (symbol != null && symbol.Kind != SymbolKind.Namespace) {
DataFlow\DynamicallyAccessedMembersBinder.cs (1)
411 switch (member.Kind) {
ISymbolExtensions.cs (1)
158 if (methodSymbol.ContainingSymbol?.Kind == SymbolKind.NamedType) {
TrimAnalysis\SingleValueExtensions.cs (1)
29 return type.Kind switch {
Microsoft.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
635foreach (var methodSymbol in targetClassSymbol.GetMembers().Where(m => m.Kind == SymbolKind.Method).OfType<IMethodSymbol>())
UsingToStringInLoggersAnalyzer.cs (1)
28if (operationBlockContext.OwningSymbol.Kind != SymbolKind.Method)
Utilities\SymbolExtensions.cs (1)
39while (symbol.Kind != SymbolKind.Namespace)
Microsoft.Analyzers.Local (4)
ApiLifecycle\ApiLifecycleAnalyzer.cs (2)
53.Where(symbol => symbol.IsExternallyVisible() && symbol.Kind == SymbolKind.NamedType) 147.Where(symbol => symbol.IsExternallyVisible() && symbol.Kind == SymbolKind.NamedType)
ApiLifecycle\AssemblyAnalysis.cs (1)
202if (member.Kind != SymbolKind.Method)
Utilities\SymbolExtensions.cs (1)
15while (symbol.Kind != SymbolKind.Namespace)
Microsoft.AspNetCore.Analyzers (4)
BuildServiceProviderAnalyzer.cs (1)
21Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
StartupAnalyzer.cs (1)
60if (context.OwningSymbol.Kind != SymbolKind.Method)
UseAuthorizationAnalyzer.cs (1)
22Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
UseMvcAnalyzer.cs (1)
21Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
Microsoft.AspNetCore.Mvc.Analyzers (1)
TopLevelParameterNameAnalyzer.cs (1)
112member.Kind != SymbolKind.Property)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
SymbolApiResponseMetadataProvider.cs (1)
111.FirstOrDefault(m => m.Kind == SymbolKind.Method && m.IsStatic && m.DeclaredAccessibility == Accessibility.Public);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
HubClientProxyGenerator.Parser.cs (2)
285.Where(member => member.Kind == SymbolKind.Method) 289.Where(member => member.Kind == SymbolKind.Method)
HubServerProxyGenerator.Parser.cs (2)
262.Where(member => member.Kind == SymbolKind.Method) 266.Where(member => member.Kind == SymbolKind.Method)
Microsoft.CodeAnalysis (42)
CodeGen\PermissionSetAttribute.cs (1)
86member => member.Kind == SymbolKind.Property && ((IPropertySymbol)member).Type.SpecialType == SpecialType.System_String));
Compilation\Compilation.cs (1)
1708switch (s.Kind)
Compilation\SymbolInfo.cs (2)
70Debug.Assert(symbol is null || symbol.Kind != SymbolKind.Namespace || ((INamespaceSymbol)symbol).NamespaceKind != NamespaceKindNamespaceGroup); 73Debug.Assert(item.Kind != SymbolKind.Namespace || ((INamespaceSymbol)item).NamespaceKind != NamespaceKindNamespaceGroup);
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
90sb.AppendLine($"{nameof(ISymbol)}: {_symbol.Name} ({_symbol.Kind})");
DiagnosticAnalyzer\AnalysisScope.cs (1)
223!((symbol.Kind == SymbolKind.Namespace && ((INamespaceSymbol)symbol).IsGlobalNamespace));
DiagnosticAnalyzer\AnalyzerDriver.cs (7)
1802if ((int)symbol.Kind < actionsByKind.Length) 1804AnalyzerExecutor.ExecuteSymbolActions(actionsByKind[(int)symbol.Kind], analyzer, symbolEvent, s_getTopmostNodeForAnalysis, isGeneratedCodeSymbol, analysisScope.FilterFileOpt?.SourceTree, analysisScope.FilterSpanOpt, cancellationToken); 2194if (symbol.ContainingSymbol.Kind != symbol.Kind) 2560var getSymbol = topmostNodeForAnalysis != declaringReferenceSyntax || declaredSymbol.Kind == SymbolKind.Namespace; 2909declaredSymbol.Kind == SymbolKind.Namespace && 2910otherSymbol.Kind == SymbolKind.Namespace &&
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
382if (kinds.Contains(symbol.Kind)) 1127switch (symbol.Kind)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (1)
185switch (symbol.Kind)
DiagnosticAnalyzer\AnalyzerManager.cs (1)
213if (symbolStartAction.Kind != symbol.Kind)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
906symbolDeclaredEvent.Symbol.Kind != SymbolKind.Namespace)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (2)
80if (symbol.Kind != SymbolKind.Namespace) 175if (symbol.Kind == SymbolKind.Namespace)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (8)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray(); 171if (containingSymbol.Kind == SymbolKind.NamedType) 203singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Namespace); 217singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Event); 222s.Kind is not SymbolKind.Namespace and 824s.Kind == SymbolKind.NamedType && 832s.Kind is SymbolKind.Namespace or
DocumentationCommentId.cs (6)
1169if (symbol.Kind == SymbolKind.NamedType) 1194if (symbol.Kind == SymbolKind.Namespace || (symbol.Kind == SymbolKind.NamedType && ((INamedTypeSymbol)symbol).Arity == 0)) 1215if (symbol.Kind == SymbolKind.Namespace) 1355if (symbol.Kind == SymbolKind.Field) 1371if (symbol.Kind == SymbolKind.Event)
Operations\ControlFlowGraphBuilder.cs (2)
4027return resource.Type == null || resource.Type.Kind == SymbolKind.DynamicType; 7957.Where(m => m.Kind == SymbolKind.Property)
SourceGeneration\GeneratedCodeUtilities.cs (1)
27if (symbol.Kind != SymbolKind.Namespace)
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (2)
199if (containingSymbol.Kind == SymbolKind.Namespace && 319if (member.Kind == SymbolKind.Field)
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (1)
68switch (candidate.Kind)
Symbols\ISymbolExtensions.cs (1)
97if (sym.Kind == SymbolKind.Namespace)
Symbols\ITypeSymbol.cs (1)
257return type?.Kind == SymbolKind.DynamicType;
Microsoft.CodeAnalysis.CodeStyle (81)
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
111IMemberReferenceOperation memberReferenceOperation => memberReferenceOperation.Member.Kind, 112IInvocationOperation invocationOperation => invocationOperation.TargetMethod.Kind,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
428switch (symbol.Kind) 742switch (memberSymbol.Kind)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
606(symbol.IsStatic && symbol.Kind == SymbolKind.Local) ||
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
111switch (symbol.Kind) 121if (symbol.Kind == SymbolKind.Property && isTopLevel)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
83if (member.Kind == SymbolKind.Field)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
287if (symbolInfo.Symbol.Kind != SymbolKind.Method)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (8)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray(); 171if (containingSymbol.Kind == SymbolKind.NamedType) 203singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Namespace); 217singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Event); 222s.Kind is not SymbolKind.Namespace and 824s.Kind == SymbolKind.NamedType && 832s.Kind is SymbolKind.Namespace or
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
27if (symbol.Kind != SymbolKind.Namespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (7)
89if (member.Kind == SymbolKind.Property) 101if (member.Kind == SymbolKind.Property) 199m.Kind != SymbolKind.NamedType && IsImplementable(m) && 209if (member.Kind != SymbolKind.Property) 299return type.GetMembers().WhereAsArray(m => m.Kind != SymbolKind.NamedType && 309if (member.Kind != SymbolKind.Property) 482switch (symbol.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (22)
33switch (symbol.Kind) 49while (symbol != null && symbol.Kind != SymbolKind.Namespace) 110if (member.Kind != symbol.Kind) 116if (symbol.Kind is SymbolKind.Event or SymbolKind.Property) 147if (symbol.Kind is not SymbolKind.Method and not SymbolKind.Property and not SymbolKind.Event) 175if (symbol.Kind == SymbolKind.Event) 180if (symbol.Kind == SymbolKind.Property) 185if (symbol.Kind == SymbolKind.Method) 222=> symbol?.Kind == SymbolKind.ArrayType; 234=> symbol?.Kind == kind; 239&& (symbol.Kind == kind1 || symbol.Kind == kind2); 245&& (symbol.Kind == kind1 || symbol.Kind == kind2 || symbol.Kind == kind3); 251&& kinds.Contains(symbol.Kind); 258=> symbol?.Kind == SymbolKind.Field && symbol.ContainingType.IsEnumType(); 338=> symbol.Kind switch 521=> symbol != null && symbol.Kind == SymbolKind.NamedType && symbol.IsStatic; 524=> symbol?.Kind == SymbolKind.Namespace; 581if (symbol.Kind != SymbolKind.Local)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
24Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (3)
93switch (symbol.Kind) 168throw ExceptionUtilities.UnexpectedValue(symbol.Kind); 192if (typeArg.Kind != SymbolKind.TypeParameter &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
601switch (type.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
180if (symbol.Kind == SymbolKind.Discard) 204if (symbol.Kind == SymbolKind.Discard)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
41if (_symbolKindsThatCanBeOverridden.Contains(symbol.Kind) && DoesSymbolImplementAnotherSymbol(symbol))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
162switch (currentSymbol.Kind) 502var kind = symbol.Kind;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
65if (symbol.Kind == SymbolKind.Alias) 74else if (symbol.Kind != SymbolKind.Namespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
55var kind = symbol.Kind; 238if (symbol.Kind != kind) 240reason = $"location {index} did not match kind: {symbol.Kind} != {kind}"; 266if (symbol?.Kind == kind &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
498if (symbol.Kind == SymbolKind.TypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (3)
451if (symbol.Kind != newSymbol.Kind) 878return symbol.Kind == SymbolKind.Method &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (4)
36if (symbol1.Kind != symbol2.Kind) 39return symbol1.Kind switch 148switch (symbol1.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
179var k = symbol.Kind; 183k = symbol.Kind;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (5)
113Debug.Assert(x.Kind == y.Kind && x.Kind == k); 367if (x.Kind == SymbolKind.ErrorType && 371Debug.Assert(y.Kind == SymbolKind.ErrorType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
44if (x.Kind == SymbolKind.DynamicType || 57=> x.Kind switch
Microsoft.CodeAnalysis.CodeStyle.Fixes (16)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
549if (parameterType.Kind == SymbolKind.TypeParameter)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
129if (symbol.Kind == SymbolKind.Property)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
365if (type.Kind == SymbolKind.ArrayType)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
145.Where(m => m.Kind != SymbolKind.Method); 385if (symbol?.Kind == symbolKind &&
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
412if (member1.Kind != member2.Kind)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (2)
57if (member1.Kind != member2.Kind)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
69if (symbol.Kind == SymbolKind.Field)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
50if (containingSymbol.Kind == SymbolKind.Namespace &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
32s.Kind is SymbolKind.Local or 37s is { Kind: SymbolKind.NamedType, IsStatic: true };
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
123return symbol.Kind == SymbolKind.Method &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
123return options.TryGetQualifyMemberAccessOption(symbol.Kind, out var symbolOptions) && !symbolOptions.Value;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (1)
58if (!simplifierOptions.TryGetQualifyMemberAccessOption(symbolInfo.Symbol.Kind, out var optionValue))
Microsoft.CodeAnalysis.CSharp (20)
Compilation\CSharpSemanticModel.cs (3)
577if (type?.Kind != SymbolKind.ErrorType) 4520switch (invocationSym.Kind) 5263switch (symbol.Kind)
Compilation\SyntaxTreeSemanticModel.cs (8)
2410switch (declaredSymbol.Kind) 2427ExceptionUtilities.UnexpectedValue(declaredSymbol.Kind); 2435switch (declaredSymbol.Kind) 2465ExceptionUtilities.UnexpectedValue(declaredSymbol.Kind); 2471switch (declaredSymbol.Kind) 2492ExceptionUtilities.UnexpectedValue(declaredSymbol.Kind); 2507case ParameterSyntax param when declaredSymbol.Kind == SymbolKind.Property && param.Parent?.Parent is RecordDeclarationSyntax recordDeclaration && recordDeclaration.ParameterList == param.Parent: 2517switch (containingSymbol.Kind)
Errors\MessageProvider.cs (2)
101if (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace)
SymbolDisplay\SymbolDisplayVisitor.cs (3)
108text = EscapeIdentifier(text, symbol?.Kind is SymbolKind.NamedType or SymbolKind.Alias); 383if (symbol.Kind != SymbolKind.Method) 465&& symbol.Kind == SymbolKind.Field
SymbolDisplay\SymbolDisplayVisitor.Types.cs (4)
53while (underlyingType.Kind == SymbolKind.ArrayType && !ShouldAddNullableAnnotation(underlyingType)); 784if (owner.Kind == SymbolKind.Method) 811if (typeArg.Kind == SymbolKind.TypeParameter) 849if (typeArg.Kind == SymbolKind.TypeParameter)
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
91{ Kind: SymbolKind.Local, DeclaringSyntaxReferences: { Length: 1 } syntaxRefs })
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
55return (containingSymbol.Kind is SymbolKind.Field or SymbolKind.Property) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
439switch (symbol.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
172if (symbolInfo.Symbol != null && symbolInfo.Symbol.Kind == SymbolKind.Namespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1069return typeInfo.Type?.Kind == SymbolKind.ArrayType; 1077if (symbol?.Kind == SymbolKind.Field) 1240if (originalMemberSymbol.Kind != rewrittenMemberSymbol.Kind)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
68if (symbol.Kind is SymbolKind.Method or SymbolKind.Property or SymbolKind.Event)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
90if (type?.Kind != SymbolKind.NamedType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
56if (symbol != null && symbol.Kind != SymbolKind.Namespace && model.GetSymbolInfo(namespacePart).Symbol is INamespaceSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
114if (targetType.Kind == SymbolKind.DynamicType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (6)
619if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 660if (returnType.Kind == SymbolKind.TypeParameter) 662if (inferredType.Kind != SymbolKind.TypeParameter) 674if (inferredType.Kind != returnType.Kind) 679switch (inferredType.Kind)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
346if (symbol is not { Kind: SymbolKind.Event })
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
52if (symbol != null && symbol.Kind == SymbolKind.Field)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (3)
153originalSymbols = originalSymbols.Where(s => !s.IsAccessor() && s.Kind != SymbolKind.Parameter).OrderBy(s => s.Name).Select(s => s).ToList(); 340var originalSymbols = originals.Where(s => !s.IsAccessor() && s.Kind != SymbolKind.Parameter).OrderBy(s => s.Name).ToList(); 424var originalSymbols = originals.Where(s => !s.IsAccessor() && s.Kind != SymbolKind.Parameter).OrderBy(s => s.Name).ToList();
SymbolKey\SymbolKeyTestBase.cs (4)
188if (s.Kind == k) 224switch (memberSymbol.Kind) 341if (v is ILocalSymbol local && (local.Type.Kind == SymbolKind.ArrayType || local.Type.Kind == SymbolKind.PointerType))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (55)
CodeGen\CodeGenDeconstructTests.cs (36)
3613Assert.Equal(SymbolKind.Field, field.Kind); 3700Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3705Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3753Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3802Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3805Assert.Equal(SymbolKind.NamedType, x1Alias.Target.Kind); 3810Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3942Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3947Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3988Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3993Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 4408Assert.Equal(SymbolKind.Parameter, symbol.Kind); 5035Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(xType).Symbol.Kind); 5041Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(yType).Symbol.Kind); 5187Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 5313Assert.Equal(SymbolKind.Local, x1Symbol.Kind); 5318Assert.Equal(SymbolKind.Local, x2Symbol.Kind); 5349Assert.Equal(SymbolKind.Local, x1Symbol.Kind); 5354Assert.Equal(SymbolKind.Local, x2Symbol.Kind); 5475Assert.Equal(SymbolKind.Field, firstX1Symbol.Kind); 5480Assert.Equal(SymbolKind.Field, secondX1Symbol.Kind); 5507Assert.Equal(SymbolKind.Field, firstYSymbol.Kind); 5512Assert.Equal(SymbolKind.Field, secondYSymbol.Kind); 5538Assert.Equal(SymbolKind.Field, firstXSymbol.Kind); 5543Assert.Equal(SymbolKind.Field, secondXSymbol.Kind); 5818Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 5821Assert.Equal(SymbolKind.NamedType, x1Alias.Target.Kind); 5826Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x3Type).Symbol.Kind); 5829Assert.Equal(SymbolKind.NamedType, x3Alias.Target.Kind); 5870Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 5876Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x3Type).Symbol.Kind); 6005Assert.Equal(SymbolKind.Discard, isymbol.Kind); 6040Assert.Equal(SymbolKind.Discard, symbol.Kind); 6049Assert.Equal(SymbolKind.Discard, symbolClone.Kind); 6093Assert.Equal(SymbolKind.Discard, symbol.Kind); 6140Assert.Equal(SymbolKind.Discard, symbol.Kind);
CodeGen\CodeGenRefLocalTests.cs (1)
4078Assert.Equal(SymbolKind.NamedType, alias.Target.Kind);
CodeGen\CodeGenTupleTest.cs (18)
5819Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind); 5824Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind); 5877Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind); 5882Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind); 5916Assert.Equal(SymbolKind.NamedType, tuple.TupleUnderlyingType.Kind); 5919Assert.Equal(SymbolKind.NamedType, tuple.Kind); 5954Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.Kind); 5959Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.Kind); 5978Assert.Equal(SymbolKind.ErrorType, tupleWithNames.Kind); 5997Assert.Equal(SymbolKind.ErrorType, tupleWithSomeNames.Kind); 6015Assert.Equal(SymbolKind.ErrorType, tupleWithNames.Kind); 6373Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind); 6398Assert.Equal(SymbolKind.NamedType, tuple.Kind); 6421Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.Kind); 6437Assert.Equal(SymbolKind.ErrorType, tupleWithNames.Kind); 6452Assert.Equal(SymbolKind.ErrorType, tupleWithNames.Kind); 6547Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind); 17374Assert.Equal(SymbolKind.Field, sym.Symbol.Kind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (50)
Attributes\AttributeTests_MarshalAs.cs (2)
34foreach (NamedTypeSymbol type in compilation.GlobalNamespace.GetMembers().Where(s => s.Kind == SymbolKind.NamedType)) 68foreach (NamedTypeSymbol type in compilation.GlobalNamespace.GetMembers().Where(s => s.Kind == SymbolKind.NamedType))
Semantics\OutVarTests.cs (3)
1164Assert.NotEqual(SymbolKind.Field, symbol.Kind); 1174if (symbol.Kind == SymbolKind.Local) 32734Assert.Equal(SymbolKind.Field, symbol.Kind);
Semantics\PatternMatchingTestBase.cs (5)
195Assert.NotEqual(SymbolKind.Field, symbol.Kind); 205if (symbol.Kind == SymbolKind.Local) 246Assert.Equal(SymbolKind.Field, symbol.Kind); 400Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 401Assert.Equal(SymbolKind.ErrorType, typeInfo.ConvertedType.Kind);
Semantics\PatternMatchingTests.cs (3)
3449Assert.Equal(SymbolKind.NamedType, typeInfo1.Type.Kind); 3453Assert.Equal(SymbolKind.NamedType, typeInfo1.Type.Kind); 3459Assert.Equal(SymbolKind.NamedType, typeInfo2.Type.Kind);
Semantics\PatternMatchingTests_ListPatterns.cs (4)
3646Assert.Equal(SymbolKind.Local, symbol.Kind); 3726Assert.Equal(SymbolKind.Local, symbol.Kind); 3741Assert.Equal(SymbolKind.Local, symbol.Kind); 4416Assert.Equal(SymbolKind.Local, symbol.Kind);
Semantics\PatternMatchingTests2.cs (1)
724Assert.Equal(SymbolKind.Local, symbol.Kind);
Semantics\PrimaryConstructorTests.cs (17)
964Assert.Equal(SymbolKind.Local, outVar.Kind); 1011Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1076Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1304Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1317Assert.Equal(SymbolKind.Local, symbol.Kind); 1328Assert.Equal(SymbolKind.Method, symbol.Kind); 1533Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1622Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1971Assert.Equal(SymbolKind.Parameter, symbol.Kind); 2645Assert.Equal(SymbolKind.Parameter, symbol.Kind); 2683Assert.Equal(SymbolKind.Parameter, symbol.Kind); 2720Assert.Equal(SymbolKind.Parameter, symbol.Kind); 2756Assert.Equal(SymbolKind.Parameter, symbol.Kind); 7822Assert.Equal(SymbolKind.Property, symbol.Kind); 7828Assert.Equal(SymbolKind.Parameter, symbol.Kind); 8762Assert.Equal(SymbolKind.Parameter, symbol.Kind); 9168Assert.Equal(SymbolKind.Parameter, symbol.Kind);
Semantics\RecordTests.cs (15)
451Assert.Equal(SymbolKind.Parameter, parameter.Kind); 457Assert.Equal(SymbolKind.Parameter, initializer.Kind); 483Assert.Equal(SymbolKind.Local, outVar.Kind); 21148Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 21378Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 21391Assert.Equal(SymbolKind.Local, symbol!.Kind); 21402Assert.Equal(SymbolKind.Method, symbol!.Kind); 21607Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 21696Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 22083Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 24647Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 24682Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 24716Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 24751Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 28348Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind);
Microsoft.CodeAnalysis.CSharp.Features (19)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
195var scopeString = GetScopeString(targetSymbol.Kind);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
287containingSymbol.Kind != SymbolKind.NamedType)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
524Kind: SymbolKind.Property or SymbolKind.Field,
Completion\CompletionProviders\CompletionUtilities.cs (1)
166if (symbol.Kind == SymbolKind.Label &&
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
334return symbol.Kind is SymbolKind.Local or
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
302if (symbol?.Kind == SymbolKind.Field &&
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
84member.Kind == SymbolKind.NamedType ||
Debugging\CSharpProximityExpressionsService.cs (1)
72if (info.Symbol.Kind == SymbolKind.Local)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1019return symbol.Kind == SymbolKind.Method && syntax is TypeDeclarationSyntax { ParameterList: { } parameterList } ? parameterList : syntax;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
142string.Format(fieldOrProperty.Kind == SymbolKind.Field ? FeaturesResources.Initialize_field_0 : FeaturesResources.Initialize_property_0, fieldOrProperty.Name),
NavigationBar\CSharpNavigationBarItemService.cs (3)
70member.Kind == SymbolKind.NamedType || 181if (member.Kind == SymbolKind.Method) 211if (symbol.Kind == SymbolKind.Field)
Rename\CSharpRenameIssuesService.cs (1)
28symbol.Kind == SymbolKind.DynamicType)
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
71symbol.Kind is SymbolKind.Local or SymbolKind.Field or SymbolKind.Parameter or SymbolKind.Property);
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
91{ Kind: SymbolKind.Local, DeclaringSyntaxReferences: { Length: 1 } syntaxRefs })
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
55return (containingSymbol.Kind is SymbolKind.Field or SymbolKind.Property) &&
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
68if (symbol.Kind is SymbolKind.Method or SymbolKind.Property or SymbolKind.Event)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
90if (type?.Kind != SymbolKind.NamedType)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IVariableDeclaration.cs (1)
943Assert.Equal(SymbolKind.Method, invocInfo.Symbol.Kind);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (164)
Semantics\ColorColorTests.cs (19)
594Assert.Equal(SymbolKind.Alias, alias.Kind); 601Assert.Equal(SymbolKind.Method, parentInfo.Symbol.Kind); 641Assert.Equal(SymbolKind.Local, info.Symbol.Kind); 1070Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1116Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1162Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1207Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1251Assert.Equal(SymbolKind.Event, candidate.Kind); 1285Assert.Equal(SymbolKind.Field, info.Symbol.Kind); 1790Assert.Equal(SymbolKind.NamedType, actualSymbol.Symbol.Kind); 1824Assert.Equal(SymbolKind.NamedType, actualSymbol.Symbol.Kind); 1848Assert.Equal(exprSymbolKind, info.Symbol.Kind); 1855Assert.Equal(parentSymbolKind, parentInfo.Symbol.Kind); 1889Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 1903Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 1946Assert.Equal(SymbolKind.Local, symbolInfo.Symbol.Kind); 1960Assert.Equal(SymbolKind.Local, symbolInfo.Symbol.Kind); 2003Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 2017Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind);
Semantics\DeconstructionTests.cs (28)
3952Assert.Equal(SymbolKind.Local, symbol.Kind); 3957Assert.NotEqual(SymbolKind.Local, symbol.Kind); 3966Assert.Equal(SymbolKind.Local, symbol.Kind); 3971Assert.NotEqual(SymbolKind.Local, symbol.Kind); 4285Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4291Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4377Assert.Equal(SymbolKind.Field, a.Kind); 4381Assert.Equal(SymbolKind.Field, b.Kind); 4385Assert.Equal(SymbolKind.Field, c.Kind); 4389Assert.Equal(SymbolKind.Field, d.Kind); 4416Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4422Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4544Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4553Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5230Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5236Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5335Assert.Equal(SymbolKind.Field, a.Kind); 5339Assert.Equal(SymbolKind.Field, b.Kind); 5343Assert.Equal(SymbolKind.Field, c.Kind); 5347Assert.Equal(SymbolKind.Field, d.Kind); 5374Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5380Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5511Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5520Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5769Assert.Equal(SymbolKind.Field, a.Kind); 5773Assert.Equal(SymbolKind.Field, b.Kind); 5777Assert.Equal(SymbolKind.Field, c.Kind); 5781Assert.Equal(SymbolKind.Field, d.Kind);
Semantics\ExpressionBodiedMemberTests.cs (4)
141Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 159Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 174Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 267Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind);
Semantics\ImplicitlyTypeArraysTests.cs (2)
69Assert.Equal(SymbolKind.Local, sym.Symbol.Kind); 97Assert.Equal(SymbolKind.ArrayType, symInfo.Symbol.Kind);
Semantics\InteractiveSemanticModelTests.cs (4)
144Assert.Equal(SymbolKind.Field, symbol.Kind); 164Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 215Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 267Assert.Equal(SymbolKind.RangeVariable, semanticInfo.Symbol.Kind);
Semantics\InteractiveUsingTests.cs (3)
44Assert.Equal(SymbolKind.Property, GetSpeculativeSymbol(sub, "NewLine").Kind); 90Assert.Equal(SymbolKind.Alias, aliasSymbol.Kind); 120Assert.Equal(SymbolKind.Alias, aliasSymbol.Kind);
Semantics\LambdaDiscardParametersTests.cs (5)
453Assert.Equal(SymbolKind.Local, localSymbol.Kind); 457Assert.Equal(SymbolKind.Parameter, parameterSymbol.Kind); 486Assert.Equal(SymbolKind.Local, localSymbol.Kind); 518Assert.Equal(SymbolKind.Local, localSymbol.Kind); 522Assert.Equal(SymbolKind.Local, parameterSymbol.Kind);
Semantics\LambdaTests.cs (4)
857Assert.Equal(SymbolKind.Method, sym.Kind); 867Assert.Equal(SymbolKind.Method, sym.Kind); 3009Assert.Equal(SymbolKind.Parameter, symbol.Kind); 3017Assert.Equal(SymbolKind.Parameter, symbol.Kind);
Semantics\LocalFunctionTests.cs (15)
4968Assert.Equal(SymbolKind.Local, b1Symbol.Kind); 6411Assert.Equal(SymbolKind.Local, symbol.Kind); 6447Assert.Equal(SymbolKind.Local, symbol.Kind); 6450Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 6491Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 6494Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 6497Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 6538Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 6541Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 6544Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 7039var actualSymbols = nodes.Select(n => model.GetSymbolInfo(n.Left).Symbol).Select(s => $"{s.Kind}: {s.ToTestDisplayString()}").ToArray(); 7373Assert.Equal(SymbolKind.TypeParameter, symbolInfo.Symbol.Kind); 7656Assert.Equal(SymbolKind.TypeParameter, typeInfo.Type.Kind); 7668Assert.Equal(symbolKind, model.GetTypeInfo(tParameterUsage).Type.Kind); 8954Assert.Equal(SymbolKind.Parameter, symbolInfo.Symbol.Kind);
Semantics\LookupTests.cs (11)
1394var systemNS = (INamespaceSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("System") && sym.Kind == SymbolKind.Namespace).Single(); 1524var namespaceX = (INamespaceSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("X") && sym.Kind == SymbolKind.Namespace).Single(); 1533var typeA = (INamedTypeSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("A") && sym.Kind == SymbolKind.NamedType).Single(); 1538var aliasY = (IAliasSymbol)actual_lookupSymbols.Where((sym) => sym.Name.Equals("aliasY") && sym.Kind == SymbolKind.Alias).Single(); 1843Assert.True(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1865Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1887Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1910Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1932Assert.False(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1955Assert.True(symbols.Any(s => s.Kind == SymbolKind.TypeParameter)); 1986Assert.True(symbols.Any(s => s.Kind == SymbolKind.TypeParameter));
Semantics\NamedAndOptionalTests.cs (1)
819Assert.Equal(SymbolKind.Parameter, symInfo.Symbol.Kind);
Semantics\NativeIntegerTests.cs (3)
238Assert.Equal(SymbolKind.NamedType, type.Kind); 317switch (underlyingMember.Kind) 734Assert.Equal(SymbolKind.ErrorType, type.Kind);
Semantics\NonTrailingNamedArgumentsTests.cs (2)
54Assert.Equal(SymbolKind.Parameter, firstASymbol.Symbol.Kind); 66Assert.Equal(SymbolKind.Parameter, secondASymbol.Symbol.Kind);
Semantics\NullableReferenceTypesTests.cs (5)
71784Assert.Equal(SymbolKind.Discard, discard1.Kind); 71788Assert.Equal(SymbolKind.Discard, discard2.Kind); 71792Assert.Equal(SymbolKind.Discard, discard3.Kind); 71796Assert.Equal(SymbolKind.Discard, discard4.Kind); 71800Assert.Equal(SymbolKind.Discard, discard5.Kind);
Semantics\OperatorTests.cs (1)
8408isChecked = isDynamic || symbol1.ContainingSymbol.Kind == SymbolKind.PointerType || symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType();
Semantics\QueryTests.cs (18)
1459Assert.Equal(SymbolKind.RangeVariable, x.Kind); 1467Assert.Equal(SymbolKind.RangeVariable, y.Kind); 1475Assert.Equal(SymbolKind.RangeVariable, z.Kind); 1668Assert.Equal(SymbolKind.RangeVariable, x.Kind); 1676Assert.Equal(SymbolKind.RangeVariable, y.Kind); 1684Assert.Equal(SymbolKind.RangeVariable, z.Kind); 2180Assert.Equal(SymbolKind.RangeVariable, info.Symbol.Kind); 2210Assert.Equal(SymbolKind.RangeVariable, info.Symbol.Kind); 2237Assert.Equal(SymbolKind.RangeVariable, info.Symbol.Kind); 2243Assert.Equal(SymbolKind.RangeVariable, info.Symbol.Kind); 2277Assert.Equal(SymbolKind.RangeVariable, symbol.Kind); 2330Assert.Equal(SymbolKind.RangeVariable, symbol.Kind); 2902Assert.Equal(SymbolKind.RangeVariable, x.Kind); 2935Assert.Equal(SymbolKind.RangeVariable, x.Kind); 3141Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 3473Assert.Equal(SymbolKind.RangeVariable, x.Kind); 3523Assert.Equal(SymbolKind.RangeVariable, symbol.Kind); 3563Assert.Equal(SymbolKind.RangeVariable, symbol.Kind);
Semantics\RecordStructTests.cs (10)
2598Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 2633Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 2667Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 2702Assert.Equal(SymbolKind.Parameter, symbol!.Kind); 3289Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 3337Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 3388Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 5852Assert.Equal(SymbolKind.Parameter, parameter.Kind); 5858Assert.Equal(SymbolKind.Parameter, initializer.Kind); 5894Assert.Equal(SymbolKind.Local, outVar.Kind);
Semantics\RefLocalsAndReturnsTests.cs (2)
4867Assert.Equal(SymbolKind.DynamicType, model.GetTypeInfo(left).Type.Kind); 4895Assert.Equal(SymbolKind.DynamicType, model.GetTypeInfo(left).Type.Kind);
Semantics\ScriptSemanticsTests.cs (1)
597if (symbol.Kind == SymbolKind.NamedType)
Semantics\TopLevelStatementsTests.cs (16)
704Assert.Equal(SymbolKind.Local, local.Kind); 706Assert.Equal(SymbolKind.Method, local.ContainingSymbol.Kind); 708Assert.Equal(SymbolKind.NamedType, local.ContainingSymbol.ContainingSymbol.Kind); 2429Assert.Equal(SymbolKind.Label, declSymbol.Kind); 3952Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4101Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4136Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4141Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4223Assert.Equal(SymbolKind.Method, local.ContainingSymbol.Kind); 4225Assert.Equal(SymbolKind.NamedType, local.ContainingSymbol.ContainingSymbol.Kind); 4899Assert.Equal(SymbolKind.Label, label.Kind); 4901Assert.Equal(SymbolKind.Method, label.ContainingSymbol.Kind); 4903Assert.Equal(SymbolKind.NamedType, label.ContainingSymbol.ContainingSymbol.Kind); 4984Assert.Equal(SymbolKind.Label, label.Kind); 4986Assert.Equal(SymbolKind.Method, label.ContainingSymbol.Kind); 4988Assert.Equal(SymbolKind.NamedType, label.ContainingSymbol.ContainingSymbol.Kind);
Semantics\UnsafeTests.cs (7)
7276Assert.Equal(SymbolKind.Local, declaredSymbol.Kind); 7859Assert.Equal(SymbolKind.Local, receiverSymbol.Kind); 7926Assert.Equal(SymbolKind.Local, receiverSymbol.Kind); 8170Assert.Equal(SymbolKind.Local, receiverSymbol.Kind); 8182Assert.Equal(SymbolKind.Local, indexSymbol.Kind); 8237Assert.Equal(SymbolKind.Field, receiverSymbol.Kind); 8295Assert.Equal(SymbolKind.Field, receiverSymbol.Kind);
Semantics\UsingStatementTests.cs (3)
64Assert.Equal(SymbolKind.Local, declaredSymbol.Kind); 1870Assert.Equal(SymbolKind.Local, symbol.Kind); 1897Assert.Equal(SymbolKind.Local, actualSymbol.Kind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (334)
Compilation\GetSemanticInfoTests.cs (19)
45Assert.Equal(SymbolKind.Parameter, sym.Symbol.Kind); 75Assert.Equal(SymbolKind.Method, sym.Symbol.Kind); 105Assert.Equal(SymbolKind.Method, sym.Symbol.Kind); 139Assert.Equal(SymbolKind.Method, sym.Symbol.Kind); 1073Assert.Equal(SymbolKind.Method, baseConstructor.Kind); 1092Assert.Equal(SymbolKind.Method, baseConstructor.Kind); 1533Assert.Equal(SymbolKind.Field, candidate.Kind); 1562Assert.Equal(SymbolKind.NamedType, symbol.Kind); 1612Assert.Equal(SymbolKind.TypeParameter, symbol.Kind); 1708Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1710Assert.Equal(SymbolKind.Method, symbol.ContainingSymbol.Kind); 1743Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1745Assert.Equal(SymbolKind.Method, symbol.ContainingSymbol.Kind); 1778Assert.Equal(SymbolKind.Parameter, symbol.Kind); 1780Assert.Equal(SymbolKind.Method, symbol.ContainingSymbol.Kind); 2541Assert.Equal(SymbolKind.Parameter, symbol.Kind); 2727Assert.Equal(SymbolKind.Local, symbol.Kind); 3556Assert.Equal(SymbolKind.Namespace, info.Symbol.Kind); 4790Assert.Equal(SymbolKind.ErrorType, lambda.ReturnType.Kind);
Compilation\GetUnusedImportDirectivesTests.cs (2)
197Assert.Equal(SymbolKind.NamedType, info.Symbol.Kind); 199Assert.Equal(SymbolKind.Namespace, info.Symbol.ContainingSymbol.Kind);
Compilation\IndexedProperties_BindingTests.cs (1)
143Assert.Equal(symbolKind, sym.Symbol.Kind);
Compilation\SemanticModelAPITests.cs (44)
155Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind); 1210Assert.Equal(parasym.Kind, argsym1.Kind); 1211Assert.Equal(parasym.Kind, argsym2.Kind); 1342Assert.Equal(SymbolKind.Alias, model.GetDeclaredSymbol(usingSyntax).Kind); 1369Assert.Equal(SymbolKind.Method, symbol.Kind); 1731Assert.Equal(SymbolKind.Alias, aliasSymbol.Kind); 1790Assert.Equal(SymbolKind.Local, local.Kind); 1802Assert.Equal(SymbolKind.Local, info.Symbol.Kind); 1809Assert.Equal(SymbolKind.Local, info2.Symbol.Kind); 1843Assert.Equal(SymbolKind.Local, local.Kind); 1856Assert.Equal(SymbolKind.Local, local.Kind); 1889Assert.Equal(SymbolKind.Label, label.Kind); 2085Assert.Equal(SymbolKind.Method, symbol.Kind); 2102Assert.Equal(SymbolKind.Method, symbol.Kind); 2286Assert.Equal(SymbolKind.Local, symbol.Kind); 2396Assert.Equal(SymbolKind.Local, local.Kind); 2408Assert.Equal(SymbolKind.Local, info.Symbol.Kind); 2579Assert.Equal(SymbolKind.Local, local.Kind); 2593Assert.Equal(SymbolKind.Local, local.Kind); 2607Assert.Equal(SymbolKind.Local, local.Kind); 2612Assert.Equal(SymbolKind.Parameter, param.Kind); 2650Assert.Equal(SymbolKind.Label, label.Kind); 2715Assert.Equal(expectedSymbolKind, symbol.Kind); 2720Assert.Equal(expectedSymbolKind, symbol.Kind); 2729Assert.Equal(expectedSymbolKind, symbol.Kind); 2734Assert.Equal(expectedSymbolKind, symbol.Kind); 2938Assert.Equal(SymbolKind.NamedType, symbol.Kind); 2944Assert.Equal(SymbolKind.NamedType, symbol.Kind); 2978Assert.Equal(SymbolKind.NamedType, symbol.Kind); 2984Assert.Equal(SymbolKind.NamedType, symbol.Kind); 3023Assert.Equal(SymbolKind.NamedType, symbol.Kind); 3028Assert.Equal(SymbolKind.NamedType, symbol.Kind); 3033Assert.Equal(SymbolKind.NamedType, symbol.Kind); 3039Assert.Equal(SymbolKind.NamedType, symbol.Kind); 3051Assert.Equal(SymbolKind.Method, symbol.Kind); 3056Assert.Equal(SymbolKind.Method, symbol.Kind); 3061Assert.Equal(SymbolKind.NamedType, symbol.Kind); 3067Assert.Equal(SymbolKind.Method, symbol.Kind); 3132Assert.Equal(SymbolKind.Parameter, symbol.Kind); 3617Assert.Equal(SymbolKind.NamedType, oldSymbol.Kind); 3624Assert.Equal(SymbolKind.NamedType, newSymbol.Kind); 3850Assert.Equal(SymbolKind.Alias, symbol.Kind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (36)
433Assert.Equal(SymbolKind.Event, symbol.Kind); 455Assert.Equal(SymbolKind.Property, symbol.Kind); 477Assert.Equal(SymbolKind.Property, symbol.Kind); 502Assert.Equal(SymbolKind.Event, symbol.Kind); 524Assert.Equal(SymbolKind.Property, symbol.Kind); 546Assert.Equal(SymbolKind.Property, symbol.Kind); 970Assert.Equal(SymbolKind.TypeParameter, ptsym.Kind); 988Assert.Equal(SymbolKind.Parameter, psym.Kind); 1090Assert.Equal(SymbolKind.NamedType, symbols[0].Kind); 1094Assert.Equal(SymbolKind.Local, symbols[0].Kind); 1131Assert.Equal(SymbolKind.NamedType, symbols[0].Kind); 1139Assert.Equal(SymbolKind.Field, symbols[0].Kind); 1143Assert.Equal(SymbolKind.Alias, symbols[0].Kind); 1180Assert.Equal(SymbolKind.NamedType, symbols[0].Kind); 1388Assert.True(symbolsInC.Any(s => s.Name == "A" && s.Kind == SymbolKind.NamedType)); 1389Assert.True(symbolsInC.Any(s => s.Name == "B" && s.Kind == SymbolKind.NamedType)); 1390Assert.True(symbolsInC.Any(s => s.Name == "C" && s.Kind == SymbolKind.NamedType)); 1391Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "A")); 1392Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "B")); 1393Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1394Assert.True(symbolsInC.Any(s => s.Name == "F" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1395Assert.True(symbolsInC.Any(s => s.Name == "System" && s.Kind == SymbolKind.Namespace)); 1396Assert.True(symbolsInC.Any(s => s.Name == "Microsoft" && s.Kind == SymbolKind.Namespace)); 1722symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 1885symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 2820Assert.Equal(SymbolKind.Namespace, n1.Kind); 3454Assert.Equal(SymbolKind.Alias, symbol.Kind); 3590Assert.Equal(SymbolKind.Method, symbol.Kind); 3615Assert.Equal(SymbolKind.Method, symbol.Kind); 3639Assert.Equal(SymbolKind.NamedType, enumTypeSymbol.Kind); 3643Assert.Equal(SymbolKind.Field, symbol.Kind); 3671Assert.Equal(SymbolKind.Parameter, info.Symbol.Kind); 3713Assert.Equal(SymbolKind.Label, symbol.Kind); 3849Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind); 4747Assert.Equal(SymbolKind.NamedType, enumSymbol.Kind); 4751Assert.Equal(SymbolKind.Event, eventSymbol.Kind);
Compilation\SemanticModelGetSemanticInfoTests.cs (168)
91Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 349Assert.Equal(SymbolKind.Field, symbol.Kind); 437Assert.Equal(SymbolKind.Field, symbol.Kind); 1649Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 1693Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 1725Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 2124Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 2157Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2197Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 2269Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 2304Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2354Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2400Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2443Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2498Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2550Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2618Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 2655Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2876Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 2912Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3078Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3123Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3163Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3205Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3251Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3290Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3326Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3363Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3400Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3498Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3561Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 3595Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3633Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3677Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3711Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3745Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3779Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 3809Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 3870Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 3905Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 4013Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 4044Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 4112Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 4141Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 4324Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 4385Assert.Equal(SymbolKind.Namespace, semanticInfo.Type.ContainingSymbol.Kind); 4410Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 4480Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 4547Assert.Equal(SymbolKind.Parameter, symbol.Kind); 4548Assert.True(symbol.ContainingSymbol.Kind == SymbolKind.Property && ((IPropertySymbol)symbol.ContainingSymbol).IsIndexer); 4575Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 4613Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 4679Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 4717Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 4753Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 4789Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 4820Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 4857Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 4884Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 4892Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.ContainingSymbol.Kind); 5205Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 5245Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 5284Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 5326Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 5548Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 5580Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 5612Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 5637Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 5662Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 5698Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 5801Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 5868Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 5937Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 6004Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 6123Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 6150Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 6183Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 6254Assert.Equal(SymbolKind.NamedType, symbol.Kind); 6335Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 6372Assert.Equal(SymbolKind.Method, symbol.Kind); 6442Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 6525Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 6560Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 6597Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 6881Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 6926Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 7000Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7029Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7053Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 7084Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7112Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7143Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7294Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7322Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7525Assert.Equal(SymbolKind.NamedType, semanticInfo.Type.Kind); 7558Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 7666Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 7705Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 7734Assert.Equal(SymbolKind.Parameter, semanticInfo.Symbol.Kind); 7759Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 7778Assert.Equal(SymbolKind.ErrorType, semanticInfo.Type.Kind); 7797Assert.Equal(SymbolKind.ErrorType, semanticInfo.Type.Kind); 7824Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 7889Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 8124Assert.Equal(SymbolKind.ErrorType, semanticInfo.Type.Kind); 8148Assert.Equal(SymbolKind.ErrorType, semanticInfo.Type.Kind); 8241Assert.Equal(SymbolKind.ErrorType, semanticInfo.Type.Kind); 8566Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 8611Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 8650Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 8857Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 8899Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 9311Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 9923Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 9957Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 9993Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 10029Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 10065Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 10109Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 10146Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 10528Assert.Equal(SymbolKind.Parameter, semanticInfo.CandidateSymbols[0].Kind); 11272Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 11309Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 11346Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 11386Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 11433Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 11644Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 11678Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 11716Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 11761Assert.Equal(SymbolKind.Namespace, semanticInfo.Symbol.Kind); 11837Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 11907Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 11979Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 12161Assert.Equal(SymbolKind.NamedType, semanticInfo.CandidateSymbols[0].Kind); 12533Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 12574Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 12616Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 12650Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 12682Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 12777Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 12809Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 12852Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 12928Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 13104Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 13139Assert.Equal(SymbolKind.Method, symbol.Kind); 13173Assert.Equal(SymbolKind.Method, symbol.Kind); 13207Assert.Equal(SymbolKind.Method, symbol.Kind); 13269Assert.Equal(SymbolKind.Field, semanticInfo.Symbol.Kind); 13329Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 13509Assert.Equal(SymbolKind.Local, semanticInfo.Symbol.Kind); 13957Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 14048Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 14087Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 14125Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 14207Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 14251Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 14632Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 14671Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 15090Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 15123Assert.Equal(SymbolKind.Method, sortedCandidates[0].Kind); 15125Assert.Equal(SymbolKind.Method, sortedCandidates[1].Kind); 15158Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.Kind); 15189Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 15220Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 15251Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 15282Assert.Equal(SymbolKind.Property, semanticInfo.Symbol.Kind); 15309Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind); 15411Assert.Equal(SymbolKind.NamedType, semanticInfo.Symbol.Kind);
DocumentationComments\CrefTests.cs (5)
6075Assert.Equal(SymbolKind.Method, methodSymbol.Kind); 6282Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind); 6288Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind); 6298Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind); 7066Assert.Equal(SymbolKind.Property, symbol.Kind);
DocumentationComments\DocumentationCommentIDTests.cs (6)
33Assert.Equal(SymbolKind.Alias, symbol.Kind); 146Assert.Equal(SymbolKind.Label, symbol.Kind); 167Assert.Equal(SymbolKind.Local, symbol.Kind); 198Assert.Equal(SymbolKind.NetModule, symbol.Kind); 240Assert.Equal(SymbolKind.Namespace, symbol.Kind); 311Assert.Equal(SymbolKind.RangeVariable, symbol.Kind);
SymbolDisplay\SymbolDisplayTests.cs (2)
5518var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 5722var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single();
Symbols\AnonymousTypesSemanticsTests.cs (10)
591Assert.Equal(SymbolKind.Method, method.Kind); 659Assert.Equal(SymbolKind.Method, method.Kind); 680Assert.Equal(SymbolKind.Method, method.Kind); 701Assert.Equal(SymbolKind.Method, method.Kind); 756Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 779Assert.Equal(SymbolKind.RangeVariable, info1.Symbol.Kind); 784Assert.Equal(SymbolKind.Property, info2.Symbol.Kind); 848Assert.Equal(SymbolKind.RangeVariable, info1.Symbol.Kind); 853Assert.Equal(SymbolKind.RangeVariable, info2.Symbol.Kind); 1406var properties = (from m in info0.Type.GetMembers() where m.Kind == SymbolKind.Property select m).ToArray();
Symbols\AssemblyAndNamespaceTests.cs (2)
37Assert.Equal(SymbolKind.Assembly, sym.Kind); 64Assert.Equal(SymbolKind.NetModule, sym.Kind);
Symbols\CompilationCreationTests.cs (1)
2528Assert.NotEqual(SymbolKind.ErrorType, typeC5.Kind);
Symbols\ConversionTests.cs (2)
2142Assert.Equal(SymbolKind.Method, symbol.Kind); 2176Assert.Equal(SymbolKind.Method, symbol.Kind);
Symbols\ExtensionMethodTests.cs (2)
3154Assert.Equal(SymbolKind.Method, firstInvocationSymbol.Kind); 3160Assert.Equal(SymbolKind.Method, secondInvocationSymbol.Kind);
Symbols\Metadata\PE\NoPia.cs (3)
1239Assert.NotEqual(SymbolKind.ErrorType, varI5.Kind); 1240Assert.NotEqual(SymbolKind.ErrorType, varI6.Kind); 1259Assert.NotEqual(SymbolKind.ErrorType, varI1.Kind);
Symbols\MissingSpecialMember.cs (2)
537Assert.Equal(SymbolKind.ErrorType, symbol.Kind); // Not available 541Assert.NotEqual(SymbolKind.ErrorType, symbol.Kind);
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (1)
83switch (member.Kind)
Symbols\Source\DeclaringSyntaxNodeTests.cs (5)
93if (symbol.Kind == SymbolKind.Namespace && ((INamespaceSymbol)symbol).IsGlobalNamespace) 143Assert.Equal(kind, sym.Kind); 356if (member.Kind == SymbolKind.Property) 523if (memb.Kind == SymbolKind.Method && ((IMethodSymbol)memb).MethodKind == MethodKind.Constructor) 577if (memb.Kind == SymbolKind.Method)
Symbols\Source\DelegateTests.cs (1)
129Assert.Equal(SymbolKind.NamedType, v.Kind);
Symbols\Source\ExternAliasTests.cs (1)
365Assert.Equal(SymbolKind.Alias, alias1.Kind);
Symbols\Source\MethodTests.cs (2)
123Assert.Equal(SymbolKind.NamedType, x.Type.Kind); 125Assert.Equal(SymbolKind.Parameter, x.Kind);
Symbols\Source\PropertyTests.cs (2)
401if (m.Kind == SymbolKind.Field) 420if (m.Kind == SymbolKind.Field)
Symbols\Source\UsingAliasTests.cs (12)
52Assert.Equal(SymbolKind.Alias, alias1.Kind); 112Assert.Equal(SymbolKind.Alias, alias1.Kind); 169Assert.Equal(SymbolKind.Alias, alias1.Kind); 227Assert.Equal(SymbolKind.Alias, alias1.Kind); 488Assert.Equal(SymbolKind.Alias, symbols[0].Kind); 509Assert.Equal(SymbolKind.Alias, symbols[0].Kind); 546Assert.Equal(SymbolKind.Alias, model.GetAliasInfo(exprSyntaxToBind).Kind); 566Assert.Equal(SymbolKind.Alias, model.GetAliasInfo(exprSyntaxToBind).Kind); 585Assert.Equal(SymbolKind.Alias, model.GetAliasInfo(exprSyntaxToBind).Kind); 605Assert.Equal(SymbolKind.Alias, model.GetAliasInfo(exprSyntaxToBind).Kind); 705Assert.Equal(SymbolKind.ErrorType, alias.Target.Kind); 748Assert.Equal(SymbolKind.ErrorType, alias.Target.Kind);
Symbols\TypeTests.cs (5)
470Assert.Equal(SymbolKind.Field, field1.Kind); 485Assert.Equal(SymbolKind.Field, field1.Kind); 631Assert.Equal(SymbolKind.Field, m.Kind); 641Assert.Equal(SymbolKind.Field, obj.Kind); 649Assert.Equal(SymbolKind.Field, dyn.Kind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
Extensions.cs (8)
723return type.Kind == SymbolKind.ErrorType; 753switch (member.Kind) 762throw ExceptionUtilities.UnexpectedValue(member.Kind); 812switch (symbol.Kind) 829throw ExceptionUtilities.UnexpectedValue(symbol.Kind); 846switch (symbol.Kind) 855throw ExceptionUtilities.UnexpectedValue(symbol.Kind); 863if (sym.Kind == SymbolKind.Namespace)
Microsoft.CodeAnalysis.CSharp.Workspaces (41)
Classification\SyntaxClassification\DiscardSyntaxClassifier.cs (1)
49if (symbolInfo.Symbol?.Kind == SymbolKind.Discard)
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (1)
55else if (symbolInfo.Symbol?.Kind == SymbolKind.Namespace)
Rename\CSharpRenameRewriterLanguageService.cs (12)
548if (symbol != null && _renamedSymbol.Kind != SymbolKind.Local && _renamedSymbol.Kind != SymbolKind.RangeVariable && 813if (renamedSymbol.Kind is SymbolKind.Parameter or 839else if (renamedSymbol.Kind == SymbolKind.Label) 848else if (renamedSymbol.Kind == SymbolKind.Method) 866else if (renamedSymbol.Kind == SymbolKind.Alias) 898else if (renamedSymbol.Kind == SymbolKind.TypeParameter) 987var implicitReferencesMightConflict = renameSymbol.Kind == SymbolKind.Property && 992(renameSymbol.Kind == SymbolKind.Method && 1057if (symbol.Kind == SymbolKind.Method) 1079else if (symbol.Kind == SymbolKind.Property && symbol.Name == "Current") 1108if (symbol.Kind == SymbolKind.Property)
Simplification\CSharpSimplificationService.Expander.cs (4)
561symbol.Kind == SymbolKind.Method && 649if (symbol.Kind is SymbolKind.NamedType or 667if (symbol.Kind is SymbolKind.Method or 743if (newNode.Kind() == SyntaxKind.IdentifierName && symbol.Kind == SymbolKind.Method)
Simplification\Reducers\CSharpExtensionMethodReducer.cs (2)
57if (targetSymbol.Symbol != null && targetSymbol.Symbol.Kind == SymbolKind.Method) 122if (newSymbol.Kind == SymbolKind.Method && oldSymbol.Equals(((IMethodSymbol)newSymbol).GetConstructedReducedFrom()))
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
145(symbol.Kind != SymbolKind.Namespace && symbol.Kind != SymbolKind.NamedType))
Simplification\Simplifiers\ExpressionSimplifier.cs (2)
376if (type?.Kind == SymbolKind.DynamicType) 420if (rightSymbol != null && (rightSymbol.IsStatic || rightSymbol.Kind == SymbolKind.NamedType))
Simplification\Simplifiers\NameSimplifier.cs (2)
85if (symbol.Kind == SymbolKind.Method && name.Kind() == SyntaxKind.GenericName) 272if (!name.IsVar && symbol.Kind == SymbolKind.NamedType && !name.IsLeftSideOfQualifiedName())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
439switch (symbol.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
172if (symbolInfo.Symbol != null && symbolInfo.Symbol.Kind == SymbolKind.Namespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1069return typeInfo.Type?.Kind == SymbolKind.ArrayType; 1077if (symbol?.Kind == SymbolKind.Field) 1240if (originalMemberSymbol.Kind != rewrittenMemberSymbol.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
56if (symbol != null && symbol.Kind != SymbolKind.Namespace && model.GetSymbolInfo(namespacePart).Symbol is INamespaceSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
114if (targetType.Kind == SymbolKind.DynamicType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
47var typeSymbol = firstSymbol != null && firstSymbol.Kind == SymbolKind.Alias
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (6)
619if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 660if (returnType.Kind == SymbolKind.TypeParameter) 662if (inferredType.Kind != SymbolKind.TypeParameter) 674if (inferredType.Kind != returnType.Kind) 679switch (inferredType.Kind)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SymbolEditorTests.cs (2)
1034var property = typeC.GetMembers().First(m => m.Kind == SymbolKind.Property); 1044var iproperty = typeI.GetMembers().First(m => m.Kind == SymbolKind.Property);
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
156if (RenameSymbol.Kind == SymbolKind.NamedType &&
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (1)
236if (sourceSymbol.Kind == SymbolKind.Field &&
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Peek\PeekHelpers.cs (1)
55switch (symbol.Kind)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
FindReferences\FindReferencesTests.vb (1)
461referencedSymbol.Definition.Kind = SymbolKind.Namespace
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
AbstractTypeParameterChecker.cs (3)
148throw ExceptionUtilities.UnexpectedValue(symbol.Kind); 153throw ExceptionUtilities.UnexpectedValue(symbol.Kind); 158throw ExceptionUtilities.UnexpectedValue(symbol.Kind);
Microsoft.CodeAnalysis.Features (98)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
229if (suppressionTargetInfo.TargetMemberNode != null && suppressionTargetInfo.TargetSymbol.Kind != SymbolKind.Namespace)
CodeLens\CodeLensReferencesService.cs (1)
225if (current.Kind != SymbolKind.Method)
Completion\CommonCompletionUtilities.cs (1)
124switch (symbol.Kind)
Completion\Providers\AbstractOverrideCompletionProvider.cs (2)
71=> symbol.Kind switch 76_ => throw ExceptionUtilities.UnexpectedValue(symbol.Kind),
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
262return kind != null && info.Symbol.Kind == kind && info.Symbol.Name == name && isGeneric == info.Symbol.GetArity() > 0;
Completion\Providers\AbstractSymbolCompletionProvider.cs (3)
60if (symbol.Kind == SymbolKind.NamedType) 72if (symbol.Kind == SymbolKind.Local) 346foreach (var symbol in symbols.GroupBy(s => new { s.Symbol.Name, s.Symbol.Kind }).Select(g => g.First()))
Completion\Providers\SymbolCompletionItem.cs (1)
90properties.Add(KeyValuePairUtil.Create("SymbolKind", ((int)symbol.Kind).ToString()));
Debugging\AbstractBreakpointResolver.cs (2)
230private static ISymbol GetPartialImplementationPartOrNull(ISymbol symbol) => symbol.Kind switch 243var kind = methodOrProperty.Kind;
DocumentHighlighting\AbstractDocumentHighlightsService.cs (3)
139switch (symbol.Kind) 215if (symbol.Kind == SymbolKind.Alias && 277switch (symbol.Kind)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (6)
320=> symbol.Kind switch 330_ => throw ExceptionUtilities.UnexpectedValue(symbol.Kind) 2432if (oldMember == null || newMember == null || oldMember.Kind != newMember.Kind) 2437switch (oldMember.Kind) 2465throw ExceptionUtilities.UnexpectedValue(oldMember.Kind);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
199=> symbol.Kind == SymbolKind.NamedType; 203return symbol.Kind is SymbolKind.Event or
ExtractInterface\AbstractExtractInterfaceService.cs (5)
96if (type == null || type.Kind != SymbolKind.NamedType) 376switch (member.Kind) 427Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString())); 444if (m.Kind == SymbolKind.Event || m.IsOrdinaryMethod()) 449if (m.Kind == SymbolKind.Property)
ExtractMethod\MethodExtractor.Analyzer.cs (2)
795foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.TypeParameter)) 919foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.Field))
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
46if (symbol is { Kind: not SymbolKind.Namespace })
FindUsages\FindUsagesHelpers.cs (1)
54return definition.Kind == SymbolKind.Parameter
GoToBase\FindBaseHelpers.cs (1)
27if (symbol.Kind is SymbolKind.Property or SymbolKind.Method or SymbolKind.Event)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
251var resource = fieldOrProperty.Kind == SymbolKind.Field
LanguageServiceIndexFormat\SymbolMoniker.cs (4)
23if (symbol.Kind is SymbolKind.Local or 38if (symbol.Kind != SymbolKind.Namespace && symbol.ContainingAssembly == null) 53if (symbol.Kind == SymbolKind.Namespace) 60if (symbol.Kind == SymbolKind.Parameter)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
61public SymbolKind Kind => _symbol.Kind;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (3)
34where m.Kind is SymbolKind.Event or 45=> m.Kind switch 52_ => throw ExceptionUtilities.UnexpectedValue(m.Kind),
MetadataAsSource\MetadataAsSourceFileService.cs (2)
83if (symbol.Kind == SymbolKind.Namespace) 286switch (symbol.Kind)
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
59topLevelNamedType.Kind != SymbolKind.NamedType)
Shared\Extensions\ISymbolExtensions_2.cs (1)
20switch (symbol.Kind)
Shared\Extensions\ISymbolExtensions_Sorting.cs (22)
165if (s1.Kind == SymbolKind.NamedType || s2.Kind == SymbolKind.NamedType) 167return s1.Kind == s2.Kind 169: s1.Kind == SymbolKind.NamedType ? -1 : 1; 172if (s1.Kind == SymbolKind.Method || s2.Kind == SymbolKind.Method) 174return s1.Kind == s2.Kind 176: s1.Kind == SymbolKind.Method ? -1 : 1; 179if (s1.Kind == SymbolKind.Property || s2.Kind == SymbolKind.Property) 181return s1.Kind == s2.Kind 183: s1.Kind == SymbolKind.Property ? -1 : 1; 186if (s1.Kind == SymbolKind.Event || s2.Kind == SymbolKind.Event) 188return s1.Kind == s2.Kind 190: s1.Kind == SymbolKind.Event ? -1 : 1; 193throw ExceptionUtilities.UnexpectedValue((s1.Kind, s2.Kind));
Shared\Utilities\ExtractTypeHelpers.cs (3)
200switch (member.Kind) 218Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString())); 238type.Kind != SymbolKind.TypeParameter &&
Snippets\SnippetFunctionService.cs (1)
64var enumFields = typeSymbol.GetMembers().Where(m => m.Kind == SymbolKind.Field && m.IsStatic);
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
111IMemberReferenceOperation memberReferenceOperation => memberReferenceOperation.Member.Kind, 112IInvocationOperation invocationOperation => invocationOperation.TargetMethod.Kind,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
742switch (memberSymbol.Kind)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
606(symbol.IsStatic && symbol.Kind == SymbolKind.Local) ||
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
111switch (symbol.Kind) 121if (symbol.Kind == SymbolKind.Property && isTopLevel)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
83if (member.Kind == SymbolKind.Field)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
287if (symbolInfo.Symbol.Kind != SymbolKind.Method)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
549if (parameterType.Kind == SymbolKind.TypeParameter)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
129if (symbol.Kind == SymbolKind.Property)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
365if (type.Kind == SymbolKind.ArrayType)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
145.Where(m => m.Kind != SymbolKind.Method); 385if (symbol?.Kind == symbolKind &&
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
412if (member1.Kind != member2.Kind)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (2)
57if (member1.Kind != member2.Kind)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
69if (symbol.Kind == SymbolKind.Field)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (8)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray(); 171if (containingSymbol.Kind == SymbolKind.NamedType) 203singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Namespace); 217singleResult = candidateMembers.FirstOrDefault(s => s.Kind == SymbolKind.Event); 222s.Kind is not SymbolKind.Namespace and 824s.Kind == SymbolKind.NamedType && 832s.Kind is SymbolKind.Namespace or
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\References\FindUsagesLSPContext.cs (1)
255if (symbol == null || symbol.Locations.IsEmpty || symbol.Kind == SymbolKind.Namespace)
Microsoft.CodeAnalysis.Test.Utilities (7)
Compilation\CompilationExtensions.cs (1)
255switch (symbol.Kind)
Compilation\ControlFlowGraphVerifier.cs (1)
1686Assert.True(false, $"{(symbol.Kind == SymbolKind.Local ? "Local" : "Method")} without owning region {symbol.ToTestDisplayString()} in [{getBlockId(block)}]\n{finalGraph()}");
Diagnostics\CommonDiagnosticAnalyzers.cs (4)
1573if (context.OwningSymbol.Kind != SymbolKind.Method || 1591if (context.OwningSymbol.Kind != SymbolKind.Method || 1606if (context.OwningSymbol.Kind != SymbolKind.Method) 1619if (context.OwningSymbol.Kind != SymbolKind.Method)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
39SymbolKind = symbol == null ? (SymbolKind?)null : symbol.Kind;
Microsoft.CodeAnalysis.UnitTests (2)
CorLibTypesTests.cs (2)
82Assert.Equal(SymbolKind.ErrorType, symbol.Kind); 86Assert.NotEqual(SymbolKind.ErrorType, symbol.Kind);
Microsoft.CodeAnalysis.VisualBasic (18)
Compilation\LexicalOrderSymbolComparer.vb (2)
37comparison = DirectCast(x, ISymbol).Kind.ToSortOrder() - DirectCast(y, ISymbol).Kind.ToSortOrder()
Compilation\SemanticModel.vb (1)
3528Select Case symbol.Kind
Errors\MessageProvider.vb (2)
98If symbol.Kind = SymbolKind.Assembly OrElse symbol.Kind = SymbolKind.Namespace Then
SymbolDisplay\SymbolDisplayVisitor.Members.vb (3)
331If associatedPropertyOrEvent.Kind = SymbolKind.Property Then 618Dim isConst = symbol.Kind = SymbolKind.Field AndAlso DirectCast(symbol, IFieldSymbol).IsConst 700symbol.Kind <> SymbolKind.Method OrElse
SymbolDisplay\SymbolDisplayVisitor.Types.vb (2)
30While underlyingNonArrayType.Kind = SymbolKind.ArrayType 498If typeArg.Kind = SymbolKind.TypeParameter Then
SymbolDisplay\SymbolDisplayVisitor.vb (2)
379containingSymbol.Kind = SymbolKind.Namespace AndAlso 394symbol.Kind = SymbolKind.Field AndAlso
Symbols\Metadata\PE\PENamedTypeSymbol.vb (4)
621Dim cmp As Integer = x.Kind.ToSortOrder - y.Kind.ToSortOrder 627Select Case x.Kind 645Throw ExceptionUtilities.UnexpectedValue(x.Kind)
Symbols\Symbol.vb (1)
1319Private ReadOnly Property ISymbol_Kind As SymbolKind Implements ISymbol.Kind, ISymbolInternal.Kind
Symbols\WellKnownMembers.vb (1)
355If type.Kind <> SymbolKind.NamedType Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
451Select Case symbol.Kind
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (2)
31Return symbol.Kind = SymbolKind.Namespace Or symbol.Kind = SymbolKind.NamedType Or AreSpecialOptionsActive(semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
49If Symbol IsNot Nothing AndAlso Symbol.Kind <> SymbolKind.Namespace AndAlso nsSymbol IsNot Nothing Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
12If symbol.Kind <> SymbolKind.Namespace OrElse symbol.Name <> "My" Then 24If symbol.Kind <> SymbolKind.Property OrElse symbol.Name <> "Forms" Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (1)
43While underlyingNonArrayType.Kind = SymbolKind.ArrayType
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (22)
CodeGen\CodeGenTuples.vb (22)
6893Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.TupleUnderlyingType.Kind) 6897Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 6927Assert.Equal(SymbolKind.NamedType, tuple.TupleUnderlyingType.Kind) 6930Assert.Equal(SymbolKind.NamedType, tuple.Kind) 6946Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.TupleUnderlyingType.Kind) 6950Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 6966Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.TupleUnderlyingType.Kind) 6970Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 6987Assert.Equal(SymbolKind.ErrorType, tupleWithSomeNames.TupleUnderlyingType.Kind) 6991Assert.Equal(SymbolKind.NamedType, tupleWithSomeNames.Kind) 7009Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 7153Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 7249Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.TupleUnderlyingType.Kind) 7253Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 7278Assert.Equal(SymbolKind.NamedType, tuple.TupleUnderlyingType.Kind) 7281Assert.Equal(SymbolKind.NamedType, tuple.Kind) 7296Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.TupleUnderlyingType.Kind) 7300Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 7314Assert.Equal(SymbolKind.ErrorType, tupleWithoutNames.TupleUnderlyingType.Kind) 7318Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 7334Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind) 7435Assert.Equal(SymbolKind.NamedType, tupleWithoutNames.Kind)
Microsoft.CodeAnalysis.VisualBasic.Features (19)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
192Dim scopeString = GetScopeString(targetSymbol.Kind)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (2)
352(symbol.Kind = SymbolKind.Method OrElse symbol.Kind = SymbolKind.Property) Then
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
241ElseIf symbol.Kind = SymbolKind.Method Then
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
105If symbol.Kind <> SymbolKind.Field Then
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
113If symbol.Kind = SymbolKind.Alias Then
Debugging\ProximityExpressionsGetter.vb (1)
81If info.Symbol.Kind = SymbolKind.Local Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (4)
794If oldSymbol.Kind = SymbolKind.Parameter Then 796ElseIf oldSymbol.Kind = SymbolKind.TypeParameter Then 1994Select Case newSymbol.Kind 2029Select Case newSymbol.Kind
ExtractMethod\Extensions.vb (1)
469Return type Is Nothing OrElse type.Kind = SymbolKind.ErrorType
NavigationBar\VisualBasicNavigationBarItemService.vb (4)
270If symbol.Kind = SymbolKind.Method Then 282If symbol.Kind = SymbolKind.Property Then 287If symbol.Kind = SymbolKind.Event Then 291If symbol.Kind = SymbolKind.Field AndAlso Not symbol.IsImplicitlyDeclared Then
SignatureHelp\GenericNameSignatureHelpProvider.Method.vb (1)
31If result.Kind <> SymbolKind.NamedType OrElse Not DirectCast(result, INamedTypeSymbol).IsScriptClass Then
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (2)
31Return symbol.Kind = SymbolKind.Namespace Or symbol.Kind = SymbolKind.NamedType Or AreSpecialOptionsActive(semanticModel)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (41)
Binding\ImplicitVariableTests.vb (2)
1025Assert.Equal(SymbolKind.Local, l1.Kind) 1072Assert.Equal(SymbolKind.Local, l1.Kind)
Compilation\CompilationAPITests.vb (2)
1488Assert.Equal(CInt(SymbolKind.NamedType), CInt(tupleWithoutNames.Kind)) 1504Assert.Equal(SymbolKind.NamedType, tupleWithNames.Kind)
Compilation\SemanticModelAPITests.vb (21)
777Assert.Equal(SymbolKind.Local, local.Kind) 789Assert.Equal(SymbolKind.Local, argSymbolInfo.Symbol.Kind) 796Assert.Equal(SymbolKind.Local, argSymbolInfo.Symbol.Kind) 834Assert.Equal(SymbolKind.Local, local.Kind) 849Assert.Equal(SymbolKind.Local, local.Kind) 908Assert.Equal(SymbolKind.Local, local.Kind) 948Assert.Equal(SymbolKind.Label, label.Kind) 1018Assert.Equal(SymbolKind.Local, local.Kind) 1054Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 1094Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 1449Assert.Equal(SymbolKind.Local, local.Kind) 1461Assert.Equal(SymbolKind.Local, argSymbolInfo.Symbol.Kind) 1598Assert.Equal(SymbolKind.Local, local.Kind) 1614Assert.Equal(SymbolKind.Local, local.Kind) 1630Assert.Equal(SymbolKind.Local, local.Kind) 1635Assert.Equal(SymbolKind.Parameter, param.Kind) 1674Assert.Equal(SymbolKind.Label, label.Kind) 1731Assert.Equal(expectedSymbolKind, symbol.Kind) 1736Assert.Equal(expectedSymbolKind, symbol.Kind) 1746Assert.Equal(expectedSymbolKind, symbol.Kind) 1751Assert.Equal(expectedSymbolKind, symbol.Kind)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (8)
2019Assert.Equal(SymbolKind.Field, varSymbol1.Kind) 2029Assert.Equal(SymbolKind.Field, varSymbol2.Kind) 2039Assert.Equal(SymbolKind.Field, varSymbol3.Kind) 2049Assert.Equal(SymbolKind.Field, varSymbol4.Kind) 2059Assert.Equal(SymbolKind.Field, varSymbol5.Kind) 2069Assert.Equal(SymbolKind.Parameter, varSymbol6.Kind) 2079Assert.Equal(SymbolKind.Local, varSymbol7.Kind) 2090Assert.Equal(SymbolKind.Local, varSymbol8.Kind)
Semantics\NameOfTests.vb (5)
140Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 1531Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 1869Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 2886Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 2951Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind)
Semantics\NativeIntegerTests.vb (1)
52Assert.Equal(SymbolKind.NamedType, type.Kind)
Semantics\UsingStatementTest.vb (2)
344If (type.Symbol.Kind = SymbolKind.Method) Then 357ElseIf (type.Symbol.Kind = SymbolKind.Field) Then
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (11)
DocumentationComments\DocCommentTests.vb (2)
6954Assert.Equal(SymbolKind.Method, method.Kind) 11968If actual.Symbol IsNot Nothing AndAlso actual.Symbol.Kind = SymbolKind.TypeParameter Then ' Works everywhere since we want it to work in name attributes.
SymbolsTests\Source\BindingsTests.vb (1)
523Assert.Equal(SymbolKind.NamedType, symbols(0).Kind)
SymbolsTests\Source\GroupClassTests.vb (6)
3286Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind) 3358Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 3764Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind) 3772Assert.Equal(SymbolKind.Property, symbolInfo.Symbol.Kind) 3780Assert.Equal(SymbolKind.Property, symbolInfo.Symbol.Kind) 3788Assert.Equal(SymbolKind.Property, symbolInfo.Symbol.Kind)
SymbolsTests\Source\OverridesTests.vb (1)
6729If member.Kind = SymbolKind.Property Then
UsedAssembliesTests.vb (1)
83Dim hasCoreLibraryRef As Boolean = comp.ObjectType.Kind = SymbolKind.NamedType
Microsoft.CodeAnalysis.VisualBasic.Workspaces (49)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
101Select Case symbol.Kind
FindSymbols\VisualBasicReferenceFinder.vb (2)
26If symbol.Kind = SymbolKind.Property Then 28ElseIf symbol.Kind = SymbolKind.NamedType Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (12)
84If symbol.Kind() = SymbolKind.Field Then 89If symbol.Kind() = SymbolKind.Local Then 288If container IsNot Nothing AndAlso container.Kind = SymbolKind.NamedType Then 363If s.Kind = SymbolKind.Event AndAlso Not _context.IsNameOfContext Then 365ElseIf s.Kind = SymbolKind.Field AndAlso s.IsImplicitlyDeclared Then 368Return associatedSymbol.Kind <> SymbolKind.Event AndAlso associatedSymbol.Kind <> SymbolKind.Property 370ElseIf s.Kind = SymbolKind.NamedType AndAlso s.IsImplicitlyDeclared Then 449If symbol.Kind = SymbolKind.Alias Then 470If namespaceOrTypeSymbol.Kind = SymbolKind.Namespace Then 490If symbol.Kind = SymbolKind.Alias Then 518If namespaceOrTypeSymbol.Kind = SymbolKind.Namespace Then
Rename\VisualBasicRenameRewriterLanguageService.vb (17)
317If symbol.Kind = SymbolKind.Field AndAlso symbol.IsImplicitlyDeclared Then 404If symbol IsNot Nothing AndAlso Me._renamedSymbol.Kind <> SymbolKind.Local AndAlso Me._renamedSymbol.Kind <> SymbolKind.RangeVariable AndAlso 695If renamedSymbol.Kind = SymbolKind.Parameter OrElse 696renamedSymbol.Kind = SymbolKind.Local OrElse 697renamedSymbol.Kind = SymbolKind.RangeVariable Then 714If renamedSymbol.Kind = SymbolKind.Parameter AndAlso 715renamedSymbol.ContainingSymbol.Kind = SymbolKind.Method Then 731If renamedSymbol.Kind = SymbolKind.Parameter AndAlso 732renamedSymbol.ContainingSymbol.Kind = SymbolKind.Property AndAlso 745ElseIf renamedSymbol.Kind = SymbolKind.Label Then 756ElseIf renamedSymbol.Kind = SymbolKind.Method Then 761ElseIf renamedSymbol.Kind = SymbolKind.Property Then 770ElseIf renamedSymbol.Kind = SymbolKind.TypeParameter Then 804Dim implicitReferencesMightConflict = renameSymbol.Kind = SymbolKind.Property AndAlso 807(renameSymbol.Kind = SymbolKind.Method AndAlso 985If symbol.Kind = SymbolKind.Property Then
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
103If symbol IsNot Nothing AndAlso symbol.Kind = SymbolKind.Method AndAlso Not DirectCast(symbol, IMethodSymbol).IsConstructor Then
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (2)
40If (Not targetSymbol.Symbol Is Nothing) AndAlso targetSymbol.Symbol.Kind = SymbolKind.Method Then 63If newSymbol.Kind = SymbolKind.Method And oldSymbol.Equals(DirectCast(newSymbol, IMethodSymbol).GetConstructedReducedFrom()) Then
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (2)
101(symbol.Kind <> SymbolKind.Namespace AndAlso symbol.Kind <> SymbolKind.NamedType) Then
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
237If leftSymbol IsNot Nothing AndAlso leftSymbol.Kind = SymbolKind.NamedType Then 239If rightSymbol IsNot Nothing AndAlso (rightSymbol.IsStatic OrElse rightSymbol.Kind = SymbolKind.NamedType) Then
Simplification\Simplifiers\NameSimplifier.vb (3)
42If symbol.Kind = SymbolKind.Method AndAlso symbol.IsConstructor() Then 46If symbol.Kind = SymbolKind.Method AndAlso name.Kind = SyntaxKind.GenericName Then 197If (symbol.Kind = SymbolKind.NamedType) AndAlso (Not name.IsLeftSideOfQualifiedName) Then
Simplification\VisualBasicSimplificationService.Expander.vb (2)
107If newNodeSymbol IsNot Nothing AndAlso newNodeSymbol.Kind = SymbolKind.Parameter Then 685If newNode.Kind = SyntaxKind.IdentifierName AndAlso symbol.Kind = SymbolKind.Method Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
451Select Case symbol.Kind
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
49If Symbol IsNot Nothing AndAlso Symbol.Kind <> SymbolKind.Namespace AndAlso nsSymbol IsNot Nothing Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
12If symbol.Kind <> SymbolKind.Namespace OrElse symbol.Name <> "My" Then 24If symbol.Kind <> SymbolKind.Property OrElse symbol.Name <> "Forms" Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (1)
43While underlyingNonArrayType.Kind = SymbolKind.ArrayType
Microsoft.CodeAnalysis.Workspaces (128)
Editing\SyntaxGenerator.cs (4)
528var invoke = symbol.Type.GetMembers("Invoke").FirstOrDefault(m => m.Kind == SymbolKind.Method) as IMethodSymbol; 720switch (symbol.Kind) 790members: type.GetMembers().Where(s => s.Kind == SymbolKind.Field).Select(Declaration)), 822switch (symbol.Kind)
FindSymbols\Declarations\DeclarationFinder.cs (2)
99if (IsOn(filter, SymbolFilter.Namespace) && symbol.Kind == SymbolKind.Namespace) 120return symbol.Kind is SymbolKind.Method or
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
45if (symbols.Any(static s => s.Kind is SymbolKind.Namespace or SymbolKind.Preprocessing))
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
86return field is { IsImplicitlyDeclared: true, AssociatedSymbol.Kind: SymbolKind.Property }
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
693switch (symbolInfo.Symbol.Kind)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
32=> symbol.Kind switch
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
39Debug.Fail($"Symbol case not handled: {symbol.Kind}");
FindSymbols\IStreamingFindReferencesProgress.cs (2)
39Debug.Assert(symbols.All(s => s.Kind == symbols[0].Kind));
FindSymbols\ReferenceLocationExtensions.cs (3)
77if (current.Kind == SymbolKind.Field) 82if (current.Kind == SymbolKind.Property) 87if (current.Kind == SymbolKind.Method)
FindSymbols\SymbolFinder.cs (4)
132switch (symbol.Kind) 244/// cref="ISymbol.Kind"/> as <paramref name="symbol"/>. This matches general user intuition that these are all 286if (linkedSymbol.Kind != symbol.Kind)
FindSymbols\SymbolFinder_Callers.cs (1)
81if (symbol.Kind is SymbolKind.Event or
FindSymbols\SymbolFinder_Helpers.cs (2)
49if (searchSymbol.Kind == SymbolKind.Namespace && symbolToMatch.Kind == SymbolKind.Namespace)
ReassignedVariable\AbstractReassignedVariableService.cs (2)
358if (localOrParameter.Kind != symbol.Kind)
Recommendations\AbstractRecommendationService.cs (2)
75switch (symbol.Kind) 120return symbol.Kind == SymbolKind.Field;
Rename\ConflictEngine\ConflictResolver.cs (2)
259.Where(s => s.Kind != SymbolKind.Method || renamedSymbol.Kind != SymbolKind.Method);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
672newReferencedSymbols = newReferencedSymbols.WhereAsArray(a => a.Kind != SymbolKind.Alias);
Rename\RenameUtilities.cs (8)
76symbol.Kind is SymbolKind.Local or 197if (containingType.Kind == SymbolKind.NamedType) 229if (symbol.Kind == SymbolKind.Method && 336if (symbol.Kind == SymbolKind.Parameter) 338if (symbol.ContainingSymbol.Kind == SymbolKind.Method) 354if (symbol.Kind == SymbolKind.NamedType) 364if (symbol.Kind == SymbolKind.Method) 376if (symbol.Kind == SymbolKind.Field)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (11)
45if (originalSymbol.Kind == SymbolKind.Parameter && referencedSymbol.Kind == SymbolKind.Parameter) 51if (referencedSymbol.Kind == SymbolKind.Field && originalSymbol.Equals(((IFieldSymbol)referencedSymbol).AssociatedSymbol)) 66if (referencedSymbol.Kind == originalSymbol.Kind && 75if (originalSymbol.Kind == SymbolKind.Alias) 106referencedSymbol.ContainingSymbol.Kind == SymbolKind.NamedType && 171if (referencedSymbol.Kind == SymbolKind.Namespace) 180if (originalSymbol.Kind == SymbolKind.Alias) 198if (referencedSymbol.Kind == SymbolKind.NamedType && referencedSymbol.Locations.All(l => l.IsInSource)) 264if (originalSymbol.Kind == SymbolKind.Alias)
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
67if (definition.Kind == SymbolKind.Property)
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
187if (namespaceOrType.Kind == SymbolKind.NamedType)
Shared\Extensions\ISymbolExtensions.cs (2)
61if (symbol.Kind == SymbolKind.Namespace) 277switch (symbol.Kind)
Shared\Extensions\ITypeSymbolExtensions.cs (1)
49if (interfaceMember.Kind is not SymbolKind.Event and
Shared\Extensions\SemanticModelExtensions.cs (1)
144if (type.Kind == SymbolKind.NamedType)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
27if (symbol.Kind != SymbolKind.Namespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (7)
89if (member.Kind == SymbolKind.Property) 101if (member.Kind == SymbolKind.Property) 199m.Kind != SymbolKind.NamedType && IsImplementable(m) && 209if (member.Kind != SymbolKind.Property) 299return type.GetMembers().WhereAsArray(m => m.Kind != SymbolKind.NamedType && 309if (member.Kind != SymbolKind.Property) 482switch (symbol.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (22)
33switch (symbol.Kind) 49while (symbol != null && symbol.Kind != SymbolKind.Namespace) 110if (member.Kind != symbol.Kind) 116if (symbol.Kind is SymbolKind.Event or SymbolKind.Property) 147if (symbol.Kind is not SymbolKind.Method and not SymbolKind.Property and not SymbolKind.Event) 175if (symbol.Kind == SymbolKind.Event) 180if (symbol.Kind == SymbolKind.Property) 185if (symbol.Kind == SymbolKind.Method) 222=> symbol?.Kind == SymbolKind.ArrayType; 234=> symbol?.Kind == kind; 239&& (symbol.Kind == kind1 || symbol.Kind == kind2); 245&& (symbol.Kind == kind1 || symbol.Kind == kind2 || symbol.Kind == kind3); 251&& kinds.Contains(symbol.Kind); 258=> symbol?.Kind == SymbolKind.Field && symbol.ContainingType.IsEnumType(); 338=> symbol.Kind switch 521=> symbol != null && symbol.Kind == SymbolKind.NamedType && symbol.IsStatic; 524=> symbol?.Kind == SymbolKind.Namespace; 581if (symbol.Kind != SymbolKind.Local)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
24Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (3)
93switch (symbol.Kind) 168throw ExceptionUtilities.UnexpectedValue(symbol.Kind); 192if (typeArg.Kind != SymbolKind.TypeParameter &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
601switch (type.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
180if (symbol.Kind == SymbolKind.Discard) 204if (symbol.Kind == SymbolKind.Discard)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
41if (_symbolKindsThatCanBeOverridden.Contains(symbol.Kind) && DoesSymbolImplementAnotherSymbol(symbol))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
162switch (currentSymbol.Kind) 502var kind = symbol.Kind;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
65if (symbol.Kind == SymbolKind.Alias) 74else if (symbol.Kind != SymbolKind.Namespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
55var kind = symbol.Kind; 238if (symbol.Kind != kind) 240reason = $"location {index} did not match kind: {symbol.Kind} != {kind}"; 266if (symbol?.Kind == kind &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
78/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
498if (symbol.Kind == SymbolKind.TypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (3)
451if (symbol.Kind != newSymbol.Kind) 878return symbol.Kind == SymbolKind.Method &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (4)
36if (symbol1.Kind != symbol2.Kind) 39return symbol1.Kind switch 148switch (symbol1.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
179var k = symbol.Kind; 183k = symbol.Kind;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (5)
113Debug.Assert(x.Kind == y.Kind && x.Kind == k); 367if (x.Kind == SymbolKind.ErrorType && 371Debug.Assert(y.Kind == SymbolKind.ErrorType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
44if (x.Kind == SymbolKind.DynamicType || 57=> x.Kind switch
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
50if (containingSymbol.Kind == SymbolKind.Namespace &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
32s.Kind is SymbolKind.Local or 37s is { Kind: SymbolKind.NamedType, IsStatic: true };
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
123return symbol.Kind == SymbolKind.Method &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
123return options.TryGetQualifyMemberAccessOption(symbol.Kind, out var symbolOptions) && !symbolOptions.Value;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (1)
58if (!simplifierOptions.TryGetQualifyMemberAccessOption(symbolInfo.Symbol.Kind, out var optionValue))
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
107Debug.Assert(symbol.Kind is SymbolKind.Assembly or SymbolKind.NetModule or SymbolKind.DynamicType);
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
90$"We should always be able to map a body symbol back to a document:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}"); 101$"Syntax tree for a body symbol should map to the same project as the body symbol's assembly:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}\r\n{documentId.ProjectId}");
Microsoft.CodeAnalysis.Workspaces.UnitTests (19)
FindReferencesTests.cs (7)
134var typeSymbol = result.Where(@ref => @ref.Definition.Kind == SymbolKind.NamedType).Single(); 547var typeResult = result.Single(r => r.Definition.Kind == SymbolKind.NamedType); 548var constructorResult = result.Single(r => r.Definition.Kind == SymbolKind.Method); 580var typeResult = result.Single(r => r.Definition.Kind == SymbolKind.NamedType); 581var constructorResult = result.Single(r => r.Definition.Kind == SymbolKind.Method); 622var typeResult = result.Single(r => r.Definition.Kind == SymbolKind.NamedType); 623var constructorResult = result.Single(r => r.Definition.Kind == SymbolKind.Method);
SymbolKeyTests.cs (12)
1035Assert.Equal(symbol.Kind, found.Kind); 1072Assert.Equal(symbol.Kind, found.Kind); 1096Assert.Equal(SymbolKind.ErrorType, propType.Kind); 1108Assert.Equal(propType.Kind, found.Kind); 1131Assert.Equal(SymbolKind.ErrorType, propType.Kind); 1143Assert.Equal(propType.Kind, found.Kind); 1178Assert.Equal(SymbolKind.ErrorType, propType.Kind); 1192Assert.Equal(propType.Kind, found.Kind); 1225Assert.Equal(SymbolKind.ErrorType, propType.Kind); 1239Assert.Equal(propType.Kind, found.Kind); 1291Assert.Equal(symbol.Kind, found.Kind); 1303Assert.Equal(symbol.Kind, found.Kind);
Microsoft.Extensions.Logging.Generators (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Extensions.Options.SourceGeneration (6)
Parser.cs (2)
82if (modelType.Kind == SymbolKind.ErrorType) 201.Where(m => m.Kind == SymbolKind.Method)
ParserUtilities.cs (2)
83property.Kind == SymbolKind.Property && !property.IsStatic && property.GetMethod != null && property.Parameters.IsEmpty)) 96property.Type.SpecialType == returnType && property.Kind == SymbolKind.Property &&
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Gen.Logging (10)
Parsing\Parser.cs (1)
152&& paramSymbol.Type.Kind != SymbolKind.TypeParameter)
Parsing\Parser.LogProperties.cs (3)
123foreach (var property in members.Where(m => m.Kind == SymbolKind.Property).Cast<IPropertySymbol>()) 318&& property.Type.Kind != SymbolKind.TypeParameter 337symType.Kind == SymbolKind.NamedType &&
Parsing\Parser.Records.cs (1)
146extractedType.Kind == SymbolKind.NamedType &&
Parsing\Parser.TagProvider.cs (2)
88var methodSymbols = providerType.GetMembers(providerMethodName).Where(m => m.Kind == SymbolKind.Method).Cast<IMethodSymbol>(); 184while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Parsing\TypeSymbolExtensions.cs (1)
82if (current.GetMembers("ToString").Where(m => m.Kind == SymbolKind.Method && m.DeclaredAccessibility == Accessibility.Public).Cast<IMethodSymbol>().Any(m => m.Parameters.Length == 0))
src\Generators\Shared\RoslynExtensions.cs (2)
148switch (symbol.Kind) 164while (symbol is not null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Gen.Logging.Unit.Tests (1)
LogParserUtilitiesTests.cs (1)
154paramTypeMock.SetupGet(x => x.Kind).Returns(SymbolKind.NamedType);
Microsoft.Gen.Metrics (3)
Parser.cs (1)
695switch (member.Kind)
src\Generators\Shared\RoslynExtensions.cs (2)
148switch (symbol.Kind) 164while (symbol is not null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
695switch (member.Kind)
Microsoft.Interop.ComInterfaceGenerator (4)
ComMethodInfo.cs (2)
52case { Kind: SymbolKind.Property }: 55case { Kind: SymbolKind.Event }:
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
38if (diagnosedSymbol.Kind != SymbolKind.Method)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Microsoft.Interop.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckNameofFixProvider.cs (1)
139foreach (IFieldSymbol s in type.GetMembers().Where(p => p.Kind == SymbolKind.Field))
Microsoft.VisualStudio.LanguageServices (37)
CallHierarchy\CallHierarchyProvider.cs (3)
58if (symbol.Kind is SymbolKind.Method or 105if (symbol.Kind is SymbolKind.Property or 144if (symbol.Kind == SymbolKind.Field)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
158if (caller.CallingSymbol.Kind == SymbolKind.Field)
Implementation\ContainedLanguageRefactorNotifyService.cs (1)
81else if (symbol.Kind is SymbolKind.Event or
Implementation\VsRefactorNotifyService.cs (1)
161if (symbol.Kind == SymbolKind.Method)
Library\ClassView\AbstractSyncClassViewCommandHandler.cs (1)
109=> symbol.Kind is SymbolKind.Event or
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (3)
208switch (symbol.Kind) 227Debug.Fail("Unsupported member kind: " + symbol.Kind.ToString()); 447|| symbol.Kind is SymbolKind.Method or SymbolKind.Property;
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
138if (symbol.Kind == SymbolKind.NamedType)
Library\ObjectBrowser\Lists\MemberListItem.cs (2)
19switch (symbol.Kind) 54Debug.Fail("Unsupported symbol for member: " + symbol.Kind.ToString());
Library\ObjectBrowser\Lists\SymbolListItem.cs (2)
32_supportsGoToDefinition = symbol.Kind != SymbolKind.Namespace; 33_supportsFindAllReferences = symbol.Kind != SymbolKind.Namespace;
Library\VsNavInfo\NavInfoFactory.cs (1)
49if (symbol.Kind is SymbolKind.Event or
Progression\GraphBuilder.cs (3)
227node[RoslynGraphProperties.SymbolKind] = symbol.Kind; 260switch (symbol.Kind) 355switch (symbol.Kind)
Progression\GraphNodeCreation.cs (1)
33switch (symbol.Kind)
Progression\GraphNodeIdCreation.cs (6)
462(symbol.ContainingSymbol.Kind != SymbolKind.Method && symbol.ContainingSymbol.Kind != SymbolKind.Property)) 469if (containingSymbol is IMethodSymbol method && method.AssociatedSymbol != null && method.AssociatedSymbol.Kind == SymbolKind.Property) 490(symbol.ContainingSymbol.Kind != SymbolKind.Method && symbol.ContainingSymbol.Kind != SymbolKind.Property)) 544if (current is { Kind: SymbolKind.Local or SymbolKind.RangeVariable } && current.Name == symbol.Name)
Progression\SymbolContainment.cs (1)
54switch (symbol.Kind)
Utilities\MemberSymbolViewModel.cs (1)
27public Visibility MakeAbstractVisibility => Symbol.Kind == SymbolKind.Field || Symbol.IsAbstract ? Visibility.Hidden : Visibility.Visible;
Venus\ContainedLanguageCodeSupport.cs (9)
104if (eventType.Kind != SymbolKind.NamedType) 178if (eventType.Kind != SymbolKind.NamedType || ((INamedTypeSymbol)eventType).DelegateInvokeMethod == null) 372if (member.Kind != SymbolKind.Method) 401return member.Kind == SymbolKind.Event; 404return member.Kind == SymbolKind.Method; 448if (member.Kind == SymbolKind.Method) 452else if (member.Kind == SymbolKind.Event) 465var members = type.GetMembers(memberName).Where(m => m.Kind == SymbolKind.Method); 497return semanticModel.LookupSymbols(typeLocation.SourceSpan.Start, objectType, nameOfEvent).SingleOrDefault(m => m.Kind == SymbolKind.Event);
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.cs (3)
3604symbol == null || symbol.Kind != SymbolKind.Method) 3644symbol == null || symbol.Kind != SymbolKind.Property) 3821if (typeSymbol.Kind != SymbolKind.NamedType ||
CodeModel\CSharpCodeModelService_Prototype.cs (5)
28switch (symbol.Kind) 48Debug.Fail("Invalid symbol kind: " + symbol.Kind); 59case VariableDeclaratorSyntax variableDeclarator when symbol.Kind == SymbolKind.Field: 70Debug.Fail(string.Format("Invalid node/symbol kind: {0}/{1}", node.Kind(), symbol.Kind)); 562if (symbol.Kind == SymbolKind.Namespace)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
208symbolMock.SetupGet(s => s.Kind).Returns(kind);
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
CodeModel\MethodXML\MethodXmlBuilder.vb (1)
324If symbol?.Kind = SymbolKind.Property Then
CodeModel\VisualBasicCodeModelService.vb (1)
2907(symbol.Kind = SymbolKind.NamedType AndAlso DirectCast(symbol, INamedTypeSymbol).TypeKind = TypeKind.Module) OrElse
CodeModel\VisualBasicCodeModelService_Prototype.vb (3)
34Select Case symbol.Kind 58Debug.Fail(String.Format("Invalid symbol kind: {0}", symbol.Kind)) 94If symbol.Kind = SymbolKind.Method Then
Progression\VisualBasicProgressionLanguageService.vb (1)
82If symbol.Kind = SymbolKind.Field AndAlso symbol.ContainingType.TypeKind = TypeKind.Enum Then
SemanticSearch.BuildTask (2)
GenerateFilteredReferenceAssembliesTask.cs (2)
264=> symbol.Kind switch 269_ => throw ExceptionUtilities.UnexpectedValue(symbol.Kind)
System.Private.CoreLib.Generators (2)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (2)
154if (member.Kind == SymbolKind.Property) 276if (symbolInfo.Symbol.Kind != SymbolKind.Property)
System.Text.Json.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)
System.Text.RegularExpressions.Generator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
99switch (symbol.Kind) 115while (symbol != null && symbol.Kind != SymbolKind.Namespace)