304 references to GetDeclaredSymbol
ILLink.CodeFixProvider (1)
BaseAttributeCodeFixProvider.cs (1)
68 var attributableSymbol = model.GetDeclaredSymbol (attributableNode, cancellationToken);
Microsoft.AspNetCore.App.Analyzers (3)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (3)
117semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken) ?? 118semanticModel.GetDeclaredSymbol(GetIdentifierOfVariableDeclarator(variableDeclarator).GetRequiredParent(), cancellationToken); 128var symbol = semanticModel.GetDeclaredSymbol(property, cancellationToken);
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2874var declaredSymbolOfDeclInNode = declInNode.DeclaredSymbol ?? semanticModel.GetDeclaredSymbol(declInNode.DeclaredNode, cancellationToken);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
113semanticModel.GetDeclaredSymbol(targetNode, cancellationToken);
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
49var declaredSymbol = model.GetDeclaredSymbol(node, cancellationToken);
Microsoft.CodeAnalysis.CodeStyle (10)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 179var symbol = semanticModel.GetDeclaredSymbol(typeDecl);
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
87var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
345if (semanticModel.GetDeclaredSymbol(propertyDeclaration, cancellationToken) is not IPropertySymbol property)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (1)
141var initializedSymbol = semanticModel.GetDeclaredSymbol(valuePattern.GetRequiredParent(), cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
49return semanticModel.GetDeclaredSymbol(declaration, cancellationToken) 131var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
66var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
264var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
729var symbol = semanticModel.GetDeclaredSymbol(node, CancellationToken);
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
53var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
50if (semanticModel.GetDeclaredSymbol(classNode, cancellationToken) is not INamedTypeSymbol classType)
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
80var symbol = (IFieldSymbol?)model.GetDeclaredSymbol(declarator, cancellationToken);
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
90var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol();
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (2)
58var methodSymbol = (IMethodSymbol?)(semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol()); 128if (semanticModel.GetDeclaredSymbol(methodDeclaration, cancellationToken) is IMethodSymbol methodSymbol)
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
38var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
74var symbol = model.GetDeclaredSymbol(node, context.CancellationToken);
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
106semanticModel.GetDeclaredSymbol(node, cancellationToken) as IMethodSymbol;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
481var declaredLocal = semanticModel.GetDeclaredSymbol(node, cancellationToken) as ILocalSymbol; 484declaredLocal = semanticModel.GetDeclaredSymbol(node.Parent, cancellationToken) as ILocalSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
83LocalSymbol = (ILocalSymbol)semanticModel.GetDeclaredSymbol(
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
531if (semanticModel.GetDeclaredSymbol(declarator, cancellationToken) is not ILocalSymbol local)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
978var symbol = semanticModel.GetSymbolInfo(current, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (3)
260return semanticModel.GetDeclaredSymbol( 282return semanticModel.GetDeclaredSymbol( 288var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
65classOrStructType = model.GetDeclaredSymbol(classOrStructDecl, cancellationToken) as INamedTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2065? currentSemanticModel.GetDeclaredSymbol(declarationInCurrentTree, CancellationToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
SymbolKey\SymbolKeyTestBase.cs (3)
259var sym = model.GetDeclaredSymbol(u); 354var sym = model.GetDeclaredSymbol(n); 365var sym = model.GetDeclaredSymbol(n);
SymbolKey\SymbolKeyTests.cs (1)
298var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(varDecl);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (21)
CodeGen\CodeGenDeconstructTests.cs (18)
3582Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)decl)); 3614Assert.Same(field, model.GetDeclaredSymbol((SyntaxNode)decl)); 5909Assert.Null(model.GetDeclaredSymbol(discard1)); 5917Assert.Null(model.GetDeclaredSymbol(discard2)); 6306Assert.Null(model.GetDeclaredSymbol(discard1)); 6338Assert.Null(model.GetDeclaredSymbol(discard1)); 6395Assert.Null(model.GetDeclaredSymbol(discard1)); 6563Assert.Null(model.GetDeclaredSymbol(discard1)); 6863Assert.Null(model.GetDeclaredSymbol(declaration1)); 6864Assert.Null(model.GetDeclaredSymbol(discard1)); 6869Assert.Null(model.GetDeclaredSymbol(declaration2)); 6870Assert.Null(model.GetDeclaredSymbol(discard2)); 6935Assert.Null(model.GetDeclaredSymbol(nestedDeclaration)); 6936Assert.Null(model.GetDeclaredSymbol(discard2)); 6976Assert.Null(model.GetDeclaredSymbol(discard1)); 6985Assert.Null(model.GetDeclaredSymbol(discard2)); 6995Assert.Null(model.GetDeclaredSymbol(discard3)); 7003Assert.Null(model.GetDeclaredSymbol(discard4));
CodeGen\CodeGenTupleEqualityTests.cs (1)
1514Assert.Null(model.GetDeclaredSymbol(t));
CodeGen\CodeGenTupleTest.cs (2)
24208Assert.Equal("System.Int32 (System.Int32 elem1, System.Int32 elem2).elem1", model.GetDeclaredSymbol((SyntaxNode)type.Elements.First()).ToTestDisplayString()); 24209Assert.Equal("System.Int32 (System.Int32 elem1, System.Int32 elem2).elem2", model.GetDeclaredSymbol((SyntaxNode)type.Elements.Last()).ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (57)
Attributes\AttributeTests_RefReadOnly.cs (2)
1455var localFunctionSymbol = newModel.GetDeclaredSymbol(localfunction); 1482var localFunctionSymbol = newModel.GetDeclaredSymbol(localfunction);
Semantics\OutVarTests.cs (38)
915Assert.Null(model.GetDeclaredSymbol(x2Ref)); 971Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)variableDeclaratorSyntax)); 1068Assert.Null(model.GetDeclaredSymbol(decl)); 1144Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)variableDesignationSyntax)); 1412Assert.Null(model.GetDeclaredSymbol(x2Ref)); 1647Assert.Null(model.GetDeclaredSymbol(x2Ref)); 22702Assert.Null(model.GetDeclaredSymbol((SyntaxNode)variableDeclaratorSyntax)); 32736Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)variableDesignationSyntax)); 32979Assert.Null(model.GetDeclaredSymbol(discard1)); 32988Assert.Null(model.GetDeclaredSymbol(discard2)); 32997Assert.Null(model.GetDeclaredSymbol(discard3)); 33064Assert.Null(model.GetDeclaredSymbol(discard1)); 33080Assert.Null(model.GetDeclaredSymbol(discard2)); 33136Assert.Null(model.GetDeclaredSymbol(discard1)); 33178Assert.Null(model.GetDeclaredSymbol(discard1)); 33194Assert.Null(model.GetDeclaredSymbol(discard2)); 33242Assert.Null(model.GetDeclaredSymbol(discard1)); 33258Assert.Null(model.GetDeclaredSymbol(discard2)); 33621var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 33707var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 34763var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 34844var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 34896var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 34950var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35008var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35059var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35112var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35151var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35185var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35224var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35268var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35299var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35338var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35371var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35407var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35446var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35476var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation); 35513var symbol = (ILocalSymbol)model.GetDeclaredSymbol(decl.Designation);
Semantics\PatternMatchingTestBase.cs (5)
85Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation)); 146Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation)); 172Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)declarator)); 186Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation)); 248Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation));
Semantics\PatternMatchingTests.cs (4)
4292Assert.Null(model.GetDeclaredSymbol(discard1)); 4299Assert.Null(model.GetDeclaredSymbol(discard2)); 4306Assert.Null(model.GetDeclaredSymbol(discard3)); 4313Assert.Null(model.GetDeclaredSymbol(discard4));
Semantics\PatternMatchingTests_ListPatterns.cs (8)
3330var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Designation)!; 3645var symbol = model.GetDeclaredSymbol(designation); 4095var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Designation)!; 4182var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Designation)!; 4259var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Designation)!; 4374var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Designation)!; 4415var symbol = model.GetDeclaredSymbol(designation); 4566var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Designation)!;
Microsoft.CodeAnalysis.CSharp.Features (13)
CodeLens\CSharpCodeLensDisplayInfoService.cs (6)
107var symbol = semanticModel.GetDeclaredSymbol(node); 122var symbol = semanticModel.GetDeclaredSymbol(node); 135var symbol = semanticModel.GetDeclaredSymbol(node); 148var symbol = semanticModel.GetDeclaredSymbol(node); 175var symbol = semanticModel.GetDeclaredSymbol(node); 194var scopeSymbol = semanticModel.GetDeclaredSymbol(scopeNode);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1027var recordType = (INamedTypeSymbol?)model.GetDeclaredSymbol(declaration.Parent, cancellationToken); 1032return model.GetDeclaredSymbol(declaration, cancellationToken);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
93var field = semanticModel.GetDeclaredSymbol(declarator, cancellationToken) as IFieldSymbol;
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
76return semanticModel.GetDeclaredSymbol(access.Parent.Parent) switch
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
62var symbol = semanticModel.GetDeclaredSymbol(foundReturnableConstruct);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
531if (semanticModel.GetDeclaredSymbol(declarator, cancellationToken) is not ILocalSymbol local)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
65classOrStructType = model.GetDeclaredSymbol(classOrStructDecl, cancellationToken) as INamedTypeSymbol;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (48)
Semantics\BindingTests.cs (3)
2890Assert.Equal("System.Reflection.PropertyInfo x", model.GetDeclaredSymbol(param).ToTestDisplayString()); 2928var symbol1 = model.GetDeclaredSymbol(param); 2970var symbol1 = model.GetDeclaredSymbol(param);
Semantics\DeconstructionTests.cs (4)
3961symbol = model.GetDeclaredSymbol(node); 4509Assert.Null(model.GetDeclaredSymbol(designation)); 5480Assert.Null(model.GetDeclaredSymbol(designation)); 5880Assert.Null(model.GetDeclaredSymbol(designation));
Semantics\IteratorTests.cs (2)
617Assert.Null(model.GetDeclaredSymbol(node)); 655Assert.Null(model.GetDeclaredSymbol(node));
Semantics\LocalFunctionTests.cs (6)
676Assert.Equal("System.Int32 i", model.GetDeclaredSymbol(decl.Designation).ToTestDisplayString()); 730Assert.Equal("System.Int32 i", model.GetDeclaredSymbol(decl.Designation).ToTestDisplayString()); 1772Assert.Null(model.GetDeclaredSymbol(a)); 1793Assert.Null(model.GetDeclaredSymbol(clsCompliant)); 1847Assert.Null(model.GetDeclaredSymbol(a)); 1868Assert.Null(model.GetDeclaredSymbol(clsCompliant));
Semantics\MethodTypeInferenceTests.cs (2)
841Assert.Null(model.GetDeclaredSymbol(discard)); 851Assert.Null(model.GetDeclaredSymbol(discard));
Semantics\NullableReferenceTypesTests.cs (7)
3696var symbol1 = model.GetDeclaredSymbol(param); 34986Assert.Null(model.GetDeclaredSymbol(outVar)); 71931Assert.Null(model.GetDeclaredSymbol(discard1)); 71932Assert.Null(model.GetDeclaredSymbol(discard1.Designation)); 71939Assert.Null(model.GetDeclaredSymbol(discard2)); 113595Assert.Equal("var!", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.ToTestDisplayString(includeNonNullable: true)); 113626Assert.Equal("var", model.GetDeclaredSymbol(decl.Designation).GetSymbol<LocalSymbol>().TypeWithAnnotations.ToTestDisplayString(includeNonNullable: true));
Semantics\QueryTests.cs (2)
2273var symbol = semanticModel.GetDeclaredSymbol(queryContinuation); 2326var symbol = semanticModel.GetDeclaredSymbol(joinInto);
Semantics\RefFieldTests.cs (8)
12383var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 12424Assert.Null(model.GetDeclaredSymbol(decl)); 12575var f = model.GetDeclaredSymbol(decl).GetSymbol<FieldSymbol>(); 12604Assert.Null(model.GetDeclaredSymbol(decl)); 12837Assert.Null(model.GetDeclaredSymbol(decl)); 13011Assert.Null(model.GetDeclaredSymbol(decl)); 14879Assert.Null(model.GetDeclaredSymbol(decl)); 29395var symbol = model.GetDeclaredSymbol(fieldInitializerSyntax.Parent);
Semantics\StackAllocInitializerTests.cs (10)
2388Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2416Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2444Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2488Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2510Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2532Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2594Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2622Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2672Assert.Null(model.GetDeclaredSymbol(@stackalloc)); 2694Assert.Null(model.GetDeclaredSymbol(@stackalloc));
Semantics\TargetTypedDefaultTests.cs (3)
2338Assert.Null(model.GetDeclaredSymbol(def)); 2462Assert.Null(model.GetDeclaredSymbol(def)); 3518Assert.Null(model.GetDeclaredSymbol(def));
Semantics\TopLevelStatementsTests.cs (1)
238Assert.Same(declSymbol.ContainingSymbol, model1.GetDeclaredSymbol((SyntaxNode)unit1));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (29)
Compilation\SemanticModelAPITests.cs (3)
177Assert.Null(model.GetDeclaredSymbol(assignment)); 1886var label = statModel.GetDeclaredSymbol(labeledStatement); 2647var label = speculativeModel.GetDeclaredSymbol(labeledStatement);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (17)
691var symbol = model.GetDeclaredSymbol(node); 3317var symbol = model.GetDeclaredSymbol(paramNode); 3344var symbol = model.GetDeclaredSymbol(paramNode); 3370var symbol = model.GetDeclaredSymbol(paramNode); 3387var symbol = model.GetDeclaredSymbol(node); 3411var symbol = model.GetDeclaredSymbol(foreachNode); 3432var symbol = model.GetDeclaredSymbol(delegateNode); 3451var symbol = model.GetDeclaredSymbol(usingNode); 3481var symbol = model.GetDeclaredSymbol(foreachNode); 3504var symbol = model.GetDeclaredSymbol(foreachNode); 3531var symbol1 = model.GetDeclaredSymbol(foreachNode1); 3537var symbol2 = model.GetDeclaredSymbol(foreachNode2); 3568var symbol = model.GetDeclaredSymbol(catchDeclaration); 3589var symbol = model.GetDeclaredSymbol(methodDecl); 3614var symbol = model.GetDeclaredSymbol(methodDecl); 3688var symbol = model.GetDeclaredSymbol(globalStmt); 5130var symbol = model.GetDeclaredSymbol(node);
SymbolDisplay\SymbolDisplayTests.cs (6)
6612var localSymbol = (IMethodSymbol)semanticModel.GetDeclaredSymbol(local); 6655var localSymbol = (IMethodSymbol)semanticModel.GetDeclaredSymbol(local); 6690var localSymbol = (IMethodSymbol)semanticModel.GetDeclaredSymbol(local); 6784var localSymbol = (IMethodSymbol)semanticModel.GetDeclaredSymbol(local); 7691Verify(SymbolDisplay.ToDisplayParts(semanticModel.GetDeclaredSymbol(structure), format), 8485var type = ((ILocalSymbol)model.GetDeclaredSymbol(name.Names[0])).Type;
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
45Assert.Equal(symbol.OriginalDefinition, model.GetDeclaredSymbol(node)); 141var sym = model.GetDeclaredSymbol(node);
Symbols\Source\NullablePublicAPITests.cs (1)
3884Assert.Equal(lambdaSymbol, model.GetDeclaredSymbol(node).ContainingSymbol, SymbolEqualityComparer.IncludeNullability);
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
978var symbol = semanticModel.GetSymbolInfo(current, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(current, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (3)
260return semanticModel.GetDeclaredSymbol( 282return semanticModel.GetDeclaredSymbol( 288var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2065? currentSemanticModel.GetDeclaredSymbol(declarationInCurrentTree, CancellationToken)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4996var declaration = semanticModel.GetDeclaredSymbol(node);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (2)
554var attributeTarget = testContext.SemanticModel.GetDeclaredSymbol(taggedNode); 910.Select(a => semanticModel.GetDeclaredSymbol(a))
SymbolFinder\DependentTypeFinderTests.cs (1)
648var firstType = (INamedTypeSymbol)semanticModel.GetDeclaredSymbol(firstDecl);
Microsoft.CodeAnalysis.Features (14)
CodeLens\CodeLensReferencesService.cs (2)
145var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken); 281var declaredSymbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
133parameter = (IParameterSymbol?)semanticModel.GetDeclaredSymbol(parameterNode, cancellationToken);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
576var declaredSymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
88var symbol = documentEditor.SemanticModel.GetDeclaredSymbol(node, cancellationToken);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
133if (semanticModel.GetDeclaredSymbol(node, cancellationToken) is ISymbol declaration)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl);
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
87var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
345if (semanticModel.GetDeclaredSymbol(propertyDeclaration, cancellationToken) is not IPropertySymbol property)
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
90var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol();
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
106semanticModel.GetDeclaredSymbol(node, cancellationToken) as IMethodSymbol;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
481var declaredLocal = semanticModel.GetDeclaredSymbol(node, cancellationToken) as ILocalSymbol; 484declaredLocal = semanticModel.GetDeclaredSymbol(node.Parent, cancellationToken) as ILocalSymbol;
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
49var declaredSymbol = model.GetDeclaredSymbol(node, cancellationToken);
Microsoft.CodeAnalysis.Features.UnitTests (3)
FindUsages\DefinitionItemFactoryTests.cs (3)
1452var f = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is LocalFunctionStatementSyntax)); 1518var x = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is VariableDeclaratorSyntax)); 1589var r = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is FromClauseSyntax));
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\CompilationExtensions.cs (1)
312roots.Add((operation, semanticModel.GetDeclaredSymbol(operation.Syntax)));
Compilation\ControlFlowGraphVerifier.cs (1)
78var declaredSymbol = model.GetDeclaredSymbol(operationRoot.Syntax);
Microsoft.CodeAnalysis.UnitTests (2)
Diagnostics\OperationTests.cs (1)
328var cfgSymbol = model.GetDeclaredSymbol(methodBodySyntax);
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1402let candidate = model.GetDeclaredSymbol(node)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
145Return semanticModel.GetDeclaredSymbol( 159Return semanticModel.GetDeclaredSymbol(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
230Return SpecializedCollections.SingletonEnumerable(semanticModel.GetDeclaredSymbol(memberDeclaration, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (1)
605localVariables = ImmutableArray.Create(DirectCast(model.GetDeclaredSymbol(forEach), ILocalSymbol))
Microsoft.CodeAnalysis.VisualBasic.Features (12)
ChangeSignature\VisualBasicChangeSignatureService.vb (7)
210semanticModel.GetDeclaredSymbol(matchingNode, cancellationToken), 215semanticModel.GetDeclaredSymbol(matchingNode, cancellationToken), 218Return semanticModel.GetDeclaredSymbol(DirectCast(matchingNode, MethodBlockSyntax).BlockStatement, cancellationToken) 220Return semanticModel.GetDeclaredSymbol(DirectCast(matchingNode, MethodBlockSyntax).BlockStatement, cancellationToken) 222Return semanticModel.GetDeclaredSymbol(DirectCast(matchingNode, ConstructorBlockSyntax).BlockStatement, cancellationToken) 225Return semanticModel.GetDeclaredSymbol(matchingNode, cancellationToken) 728results.Add(semanticModel.GetDeclaredSymbol(cast.Identifier.Parent, cancellationToken))
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
264Dim boundEvent = TryCast(semanticModel.GetDeclaredSymbol(node.Parent.Parent, cancellationToken), IEventSymbol)
CodeLens\VisualBasicDisplayInfoService.vb (2)
124Dim symbol As ISymbol = semanticModel.GetDeclaredSymbol(node) 131symbol = semanticModel.GetDeclaredSymbol(node)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
638Return model.GetDeclaredSymbol(declaration, cancellationToken)
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (1)
47Dim Symbol = semanticModel.GetDeclaredSymbol(exitTarget)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (5)
Compilation\GetSemanticInfoBrokenCodeTests.vb (1)
495model.GetDeclaredSymbol(node)
Compilation\SemanticModelAPITests.vb (2)
945Dim label = speculativeModel.GetDeclaredSymbol(speculatedStatement) 1671Dim label = speculativeModel.GetDeclaredSymbol(speculatedMethod.Statements(0))
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
916Return semanticModel.GetDeclaredSymbol(syntax)
Extensions.vb (1)
52Return DirectCast(model.GetDeclaredSymbol(node, cancellationToken), Symbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
145Return semanticModel.GetDeclaredSymbol( 159Return semanticModel.GetDeclaredSymbol(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
230Return SpecializedCollections.SingletonEnumerable(semanticModel.GetDeclaredSymbol(memberDeclaration, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (1)
605localVariables = ImmutableArray.Create(DirectCast(model.GetDeclaredSymbol(forEach), ILocalSymbol))
Microsoft.CodeAnalysis.Workspaces (19)
Editing\SymbolEditor.cs (2)
301var newSymbol = model.GetDeclaredSymbol(newDeclaration, cancellationToken); 492var newSymbol = model.GetDeclaredSymbol(newDeclaration, cancellationToken);
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
142var symbol = semanticModel.GetDeclaredSymbol(token.GetRequiredParent(), cancellationToken); 173var declaredSymbol = semanticModel.GetDeclaredSymbol(current);
FindSymbols\SymbolFinder.cs (1)
223var linkedSymbol = semanticModel.GetDeclaredSymbol(linkedNode, cancellationToken);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
227return semanticModel.GetDeclaredSymbol(node, cancellationToken);
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (1)
45var symbol = semanticModel.GetDeclaredSymbol(decl, cancellationToken);
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (2)
117var symbol = semanticModel.GetDeclaredSymbol(name.GetRequiredParent(), cancellationToken); 175var symbol = semanticModel.GetDeclaredSymbol(token.Parent, cancellationToken);
ReassignedVariable\AbstractReassignedVariableService.cs (3)
136var parameter = semanticModel.GetDeclaredSymbol(parameterSyntax, cancellationToken) as IParameterSymbol; 143var local = semanticModel.GetDeclaredSymbol(variable, cancellationToken) as ILocalSymbol; 150var local = semanticModel.GetDeclaredSymbol(designation, cancellationToken) as ILocalSymbol;
Rename\Renamer.RenameSymbolDocumentAction.cs (1)
107var symbol = semanticModel.GetDeclaredSymbol(matchingDeclaration, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
49return semanticModel.GetDeclaredSymbol(declaration, cancellationToken) 131var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
66var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
264var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
729var symbol = semanticModel.GetDeclaredSymbol(node, CancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
83LocalSymbol = (ILocalSymbol)semanticModel.GetDeclaredSymbol(
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
FindReferencesTests.cs (5)
187var symbol = semanticModel.GetDeclaredSymbol(declareMethod); 192symbol = semanticModel.GetDeclaredSymbol(normalMethod); 223var symbol = semanticModel.GetDeclaredSymbol(propertyStatement); 291var symbol = semanticModel.GetDeclaredSymbol(declareMethod); 296symbol = semanticModel.GetDeclaredSymbol(normalMethod);
SymbolKeyTests.cs (3)
679var symbols = tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.UsingDirectiveSyntax>().Select(s => model.GetDeclaredSymbol(s)).ToList(); 1507var symbol = model.GetDeclaredSymbol(node); 1573var symbol = model.GetDeclaredSymbol(token);
Microsoft.Gen.ContextualOptions (2)
ContextReceiver.cs (1)
47.SelectMany(declarations => declarations.Select(declaration => (symbol: compilation.GetSemanticModel(declarations.Key).GetDeclaredSymbol(declaration), declaration)))
ContextualOptionsGenerator.cs (1)
39.SelectMany(declarations => declarations.Select(declaration => (symbol: compilation.GetSemanticModel(declarations.Key).GetDeclaredSymbol(declaration), declaration)))
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
76var declaringType = editor.SemanticModel.GetDeclaredSymbol(node, ct); 125IMethodSymbol method = (IMethodSymbol)editor.SemanticModel.GetDeclaredSymbol(member, ct);
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (1)
169if (editor.SemanticModel.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol methodSymbol)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
36ISymbol diagnosedSymbol = model.GetDeclaredSymbol(diagnostic.Location.SourceTree.GetRoot(context.CancellationToken).FindNode(diagnostic.Location.SourceSpan), context.CancellationToken);
Microsoft.ML.InternalCodeAnalyzer (2)
NameFixProvider.cs (1)
107ISymbol typeSymbol = semanticModel.GetDeclaredSymbol(identifier, cancellationToken);
RelaxTestNamingSuppressor.cs (1)
45var declaredSymbol = semanticModel.GetDeclaredSymbol(node, context.CancellationToken);
Microsoft.VisualStudio.LanguageServices (2)
Progression\GraphNodeIdCreation.cs (1)
543var current = semanticModel.GetDeclaredSymbol(node, cancellationToken);
Progression\SymbolContainment.cs (1)
40var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
963: semanticModel.GetDeclaredSymbol(node);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
GoToDefinition\GoToDefinitionApiTests.vb (1)
30.Select(Function(n) semanticModel.GetDeclaredSymbol(n, CancellationToken.None)) _
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService.vb (1)
1069semanticModel.GetDeclaredSymbol(node))
Help\VisualBasicHelpContextService.Visitor.vb (1)
952Dim symbol = _semanticModel.GetDeclaredSymbol(token.Parent, _cancellationToken)