312 references to GetDeclaredSymbol
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
CastSimplifier.cs (1)
949var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
107var local = semanticModel.GetDeclaredSymbol(localDeclaration.Declaration.Variables[0], cancellationToken);
SemanticModelExtensions.cs (3)
228return semanticModel.GetDeclaredSymbol( 239return semanticModel.GetDeclaredSymbol( 298var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
86declaratorToRemoveType = semanticModel.GetDeclaredSymbol(declaratorToRemoveNode, cancellationToken).GetSymbolType();
CSharpAsAndNullCheckCodeFixProvider.cs (1)
138if (semanticModel.GetDeclaredSymbol(declarator, cancellationToken) is ILocalSymbol local)
CSharpInlineDeclarationCodeFixProvider.cs (1)
230var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
CSharpTypeInferenceService.TypeInferrer.cs (1)
2231var symbol = SemanticModel.GetDeclaredSymbol(variableDeclarator);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
143var localSymbol = semanticModel.GetDeclaredSymbol(
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (78)
CodeGen\CodeGenDeconstructTests.cs (8)
1370Assert.Equal("(System.Int32 x, System.Int32 y) z", model.GetDeclaredSymbol(x).ToTestDisplayString()); 1427Assert.Equal("(System.Int32 x, System.Int32 y) z", model.GetDeclaredSymbol(x).ToTestDisplayString()); 1670Assert.Equal("(System.Int32 x, System.Int32 y) a", model.GetDeclaredSymbol(declarations.ElementAt(4)).ToTestDisplayString()); 1672Assert.Equal("(System.Int32, System.Int32) b", model.GetDeclaredSymbol(declarations.ElementAt(5)).ToTestDisplayString()); 1674Assert.Equal("(System.Int32, System.Int32 x) c", model.GetDeclaredSymbol(declarations.ElementAt(6)).ToTestDisplayString()); 1676var x = (ILocalSymbol)model.GetDeclaredSymbol(declarations.ElementAt(7)); 1681model.GetDeclaredSymbol(declarations.ElementAt(8)).ToTestDisplayString()); 5473var firstX1Symbol = model.GetDeclaredSymbol(firstX1);
CodeGen\CodeGenRefLocalTests.cs (3)
3258Assert.Equal("System.Int32 x", model.GetDeclaredSymbol(xDecl).ToTestDisplayString()); 3295Assert.Equal("C x", model.GetDeclaredSymbol(xDecl).ToTestDisplayString()); 3329Assert.Equal("System.Int32 x", model.GetDeclaredSymbol(xDecl).ToTestDisplayString());
CodeGen\CodeGenTupleTest.cs (67)
1616var xSymbol = model.GetDeclaredSymbol(x).GetSymbol<SourceLocalSymbol>().Type; 3224model.GetDeclaredSymbol(x).ToTestDisplayString()); 3257model.GetDeclaredSymbol(x).ToTestDisplayString()); 4020var resultSymbol = model.GetDeclaredSymbol(result); 8306Assert.Equal("(System.Int16 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8363Assert.Equal("(System.Int16 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8421Assert.Equal("(System.Int16 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8468Assert.Equal("(System.Int16 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8565Assert.Equal("(System.Int32 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8612Assert.Equal("(System.Int32 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8647Assert.Equal("(System.Int32 a, System.String b)? x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8676Assert.Equal("(System.Int32 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8705Assert.Equal("(System.Int32 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8734Assert.Equal("(System.Int16 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8790Assert.Equal("(System.Int16 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8819Assert.Equal("(System.Int16 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8863Assert.Equal("(System.Int16 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8908Assert.Equal("(System.Int16 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 8973Assert.Equal("(System.Int16 a, System.String b) x", model.GetDeclaredSymbol(x).ToTestDisplayString()); 9863Assert.Equal("(System.Int32 a, dynamic) t1", model.GetDeclaredSymbol(t1).ToTestDisplayString()); 9866Assert.Equal("(System.Int32 a, dynamic) t2", model.GetDeclaredSymbol(t2).ToTestDisplayString()); 9869Assert.Equal("(System.Int32 a, dynamic) t3", model.GetDeclaredSymbol(t3).ToTestDisplayString()); 9872Assert.Equal("dynamic d1", model.GetDeclaredSymbol(d1).ToTestDisplayString()); 9875Assert.Equal("dynamic d2", model.GetDeclaredSymbol(d2).ToTestDisplayString()); 9878Assert.Equal("T d3", model.GetDeclaredSymbol(d3).ToTestDisplayString()); 9914Assert.Equal("((System.Int32 a, dynamic), System.Int32 c)[] t1", model.GetDeclaredSymbol(t1).ToTestDisplayString()); 9917Assert.Equal("((System.Int32 a, dynamic), System.Int32 c)[] t2", model.GetDeclaredSymbol(t2).ToTestDisplayString()); 9920Assert.Equal("((System.Int32 a, dynamic), System.Int32 c)[] t3", model.GetDeclaredSymbol(t3).ToTestDisplayString()); 9957model.GetDeclaredSymbol(t1).ToTestDisplayString()); 9961model.GetDeclaredSymbol(t2).ToTestDisplayString()); 9965model.GetDeclaredSymbol(t3).ToTestDisplayString()); 10003model.GetDeclaredSymbol(t1).ToTestDisplayString()); 10007model.GetDeclaredSymbol(t2).ToTestDisplayString()); 10011model.GetDeclaredSymbol(t3).ToTestDisplayString()); 10066Assert.Equal("(System.Int32, System.Int32, System.Int32) t1", model.GetDeclaredSymbol(t1).ToTestDisplayString()); 10105Assert.Equal("System.Collections.Generic.IEnumerable<(System.Int32 a, dynamic)> t1", model.GetDeclaredSymbol(t1).ToTestDisplayString()); 10108Assert.Equal("System.Collections.Generic.IEnumerable<(System.Int32 a, dynamic)> t2", model.GetDeclaredSymbol(t2).ToTestDisplayString()); 10141Assert.Equal("(System.Int64 a, System.Int64 d) t1", model.GetDeclaredSymbol(t1).ToTestDisplayString()); 10144Assert.Equal("(System.Int64 a, System.Int64 d) t2", model.GetDeclaredSymbol(t2).ToTestDisplayString()); 16575var xSymbol = (INamedTypeSymbol)((ILocalSymbol)model.GetDeclaredSymbol(x)).Type; 16612var xSymbol = (INamedTypeSymbol)((ILocalSymbol)model.GetDeclaredSymbol(x)).Type; 17444var x1Symbol = (ILocalSymbol)model.GetDeclaredSymbol(x1); 19237var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19240var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(5).First()); 19299var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(2)); 19302var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(3)); 19305var x3 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(4)); 19308var x4 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(5)); 19311var x5 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(6)); 19314var x6 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(7)); 19317var x7 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(8)); 19320var x8 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(9)); 19323var x9 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(10)); 19326var x6double = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(11)); 19402var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19405var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(2).First()); 19432var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19486var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First()); 19544var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First()); 21355Assert.Equal("<anonymous type: (System.Int32 a, System.Int32 b) Tuple> x1", model.GetDeclaredSymbol(x1).ToTestDisplayString()); 21358Assert.Equal("<anonymous type: (System.Int32 c, System.Int32) Tuple> x2", model.GetDeclaredSymbol(x2).ToTestDisplayString()); 22890var xSymbol = ((ILocalSymbol)model.GetDeclaredSymbol(x)).Type; 24435var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 24508var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 24581var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 24655var collectionSymbol = (model.GetDeclaredSymbol(collection) as ILocalSymbol)?.Type; 25064var xSymbol = ((ILocalSymbol)model.GetDeclaredSymbol(x)).Type;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (5)
Emit\NumericIntPtrTests.cs (1)
699var actualLocals = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString());
Semantics\PatternMatchingTestBase.cs (1)
168var symbol = model.GetDeclaredSymbol(declarator);
Semantics\PatternMatchingTests_ListPatterns.cs (1)
3339var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration)!;
Semantics\PatternMatchingTests_Scope.cs (2)
6526Assert.Equal("System.Boolean d", model.GetDeclaredSymbol(d).ToTestDisplayString()); 12212var symbol = (ILocalSymbol)model.GetDeclaredSymbol(e);
Microsoft.CodeAnalysis.CSharp.Features (14)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
388var localSymbol = (ILocalSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
257var field = (IFieldSymbol?)semanticModel.GetDeclaredSymbol(variable, cancellationToken);
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
86declaratorToRemoveType = semanticModel.GetDeclaredSymbol(declaratorToRemoveNode, cancellationToken).GetSymbolType();
CSharpAsAndNullCheckCodeFixProvider.cs (1)
138if (semanticModel.GetDeclaredSymbol(declarator, cancellationToken) is ILocalSymbol local)
CSharpInlineDeclarationCodeFixProvider.cs (1)
230var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
143var localSymbol = semanticModel.GetDeclaredSymbol(
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
107var local = semanticModel.GetDeclaredSymbol(localDeclaration.Declaration.Variables[0], cancellationToken);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (4)
1357return OneOrMany.Create((oldModel.GetDeclaredSymbol(oldVariables[0], cancellationToken), newModel.GetDeclaredSymbol(newVariables[0], cancellationToken), EditKind.Update)); 1362select (oldModel.GetDeclaredSymbol(oldVariable, cancellationToken), newModel.GetDeclaredSymbol(newVariable, cancellationToken), EditKind.Update);
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
97var field = semanticModel.GetDeclaredSymbol(declarator, cancellationToken) as IFieldSymbol; 151return declarators.Select(d => semanticModel.GetDeclaredSymbol(d, cancellationToken) as IFieldSymbol)
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
89var local = semanticModel.GetDeclaredSymbol(variable, cancellationToken) as ILocalSymbol;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (124)
Semantics\AwaitExpressionTests.cs (1)
274var symbolV = (ILocalSymbol)semanticModel.GetDeclaredSymbol(decl);
Semantics\DeconstructionTests.cs (1)
1845model.GetDeclaredSymbol(y).ToTestDisplayString());
Semantics\DelegateTypeTests.cs (2)
7682var symbol = model.GetDeclaredSymbol(variable); 11045var local = (ILocalSymbol)model.GetDeclaredSymbol(variable)!;
Semantics\FunctionPointerTests.cs (3)
2068var local = (ILocalSymbol)model.GetDeclaredSymbol(localSyntax)!; 3786Assert.Equal("delegate*<System.Void> C.field", model.GetDeclaredSymbol(fieldVariable).ToTestDisplayString()); 3802Assert.Equal("delegate*<System.Void> local", model.GetDeclaredSymbol(localVariable).ToTestDisplayString());
Semantics\LambdaTests.cs (1)
8088var constSymbol = model.GetDeclaredSymbol(decls[0].Declaration.Variables.Single());
Semantics\LocalFunctionTests.cs (3)
1721var localSymbol = model.GetDeclaredSymbol(x).ContainingSymbol.GetSymbol<LocalFunctionSymbol>(); 4650var symbol = (ILocalSymbol)model.GetDeclaredSymbol(declarator); 7017var actualSymbols = nodes.Select(n => model.GetDeclaredSymbol(n)).ToTestDisplayStrings();
Semantics\LockTests.cs (3)
46var localSymbol = (ILocalSymbol)model.GetDeclaredSymbol(localDecl.Declaration.Variables.Single()); 604var symbol = (ILocalSymbol)model.GetDeclaredSymbol(localDecl.Declaration.Variables.Single()); 628var symbol = (ILocalSymbol)model.GetDeclaredSymbol(localDecl.Declaration.Variables.Single());
Semantics\NativeIntegerTests.cs (3)
1789var actualLocals = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString()); 2346var actualLocals = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString()); 2466var actualLocals = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Select(d => model.GetDeclaredSymbol(d).ToTestDisplayString());
Semantics\NullableReferenceTypesTests.cs (42)
5159var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 33064var symbol = model.GetDeclaredSymbol(variable).GetSymbol<LocalSymbol>(); 56564var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56598var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56626var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56658var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56687var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56720var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56752var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56785var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56819var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56846var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56874var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 56904var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 56908symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 56912symbol = model.GetDeclaredSymbol(declarators[2]).GetSymbol<LocalSymbol>(); 67836var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 67839symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 67872var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 67875symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 67913var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 67916symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 67950var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 67953symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 67987var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 67990symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 68022var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 68025symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 68055var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 68092var symbol = model.GetDeclaredSymbol(declarators[0]).GetSymbol<LocalSymbol>(); 68095symbol = model.GetDeclaredSymbol(declarators[1]).GetSymbol<LocalSymbol>(); 77613var symbol = model.GetDeclaredSymbol(declarator).GetSymbol<LocalSymbol>(); 90554var symbol = model.GetDeclaredSymbol(localDeclaration); 141090var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 141131var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 141171var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 141209var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 141247var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 141351var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 141390var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 150519var symbol = (ILocalSymbol)model.GetDeclaredSymbol(syntax); 154410var local = (ILocalSymbol)model.GetDeclaredSymbol(declaration.Variables.Single());
Semantics\OutVarTests.cs (6)
9703Assert.Equal("System.Boolean d", model.GetDeclaredSymbol(d).ToTestDisplayString()); 21357var symbol = (ILocalSymbol)model.GetDeclaredSymbol(e); 32173var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single()); 32213var b = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "b").Single()); 32253var a = (IFieldSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Where(d => d.Identifier.ValueText == "a").Single()); 32327var b = (IFieldSymbol)model.GetDeclaredSymbol(bDecl);
Semantics\RefEscapingTests.cs (1)
72return ((ILocalSymbol)model.GetDeclaredSymbol(decl)).Type;
Semantics\RefFieldTests.cs (30)
10677var delegateType = (NamedTypeSymbol)model.GetDeclaredSymbol(decl).GetSymbol<LocalSymbol>().Type; 10772var methods = decls.Select(d => ((FunctionPointerTypeSymbol)model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>().Type).Signature).ToArray(); 11569var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 11643var f = model.GetDeclaredSymbol(decl).GetSymbol<FieldSymbol>(); 11706var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 12659var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 12714var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 12845var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 12870var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 12947var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13011var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13222var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13863var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13905var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 14030var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 17399var delegateInvokeMethods = decls.Select(d => ((ILocalSymbol)model.GetDeclaredSymbol(d)).Type.GetSymbol<NamedTypeSymbol>().DelegateInvokeMethod).ToArray(); 22292var types = decls.Select(d => (NamedTypeSymbol)model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>().Type).ToArray(); 22360var types = decls.Select(d => (NamedTypeSymbol)model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>().Type).ToArray(); 24220var delegateType = (NamedTypeSymbol)model.GetDeclaredSymbol(decl).GetSymbol<LocalSymbol>().Type; 26036var type = (NamedTypeSymbol)model.GetDeclaredSymbol(node).GetSymbol<LocalSymbol>().Type; 26088var type = (NamedTypeSymbol)model.GetDeclaredSymbol(node).GetSymbol<LocalSymbol>().Type; 26140var type = (NamedTypeSymbol)model.GetDeclaredSymbol(node).GetSymbol<LocalSymbol>().Type; 26293var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26383var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26503var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26604var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26649var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26709var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26939var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 26987var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray();
Semantics\ScriptSemanticsTests.cs (1)
539var symbol0 = model.GetDeclaredSymbol(declarations[0]);
Semantics\TopLevelStatementsTests.cs (16)
482var declSymbol = model1.GetDeclaredSymbol(localDecl); 534var declSymbol = model1.GetDeclaredSymbol(localDecl); 574var declSymbol = model1.GetDeclaredSymbol(localDecl); 701var local = model.GetDeclaredSymbol(declarator); 871var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single()); 877var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single()); 985var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 989var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Skip(1).Single()); 1040var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 1674var declSymbol = model1.GetDeclaredSymbol(localDecl); 1847var declSymbol = model1.GetDeclaredSymbol(localDecl); 6019var declSymbol = model1.GetDeclaredSymbol(localDecl); 6035declSymbol = model1.GetDeclaredSymbol(localDecl); 6269var x = semanticModel.GetDeclaredSymbol(localDecl); 6314var xDecl = semanticModel1.GetDeclaredSymbol(localDecl); 6365var xDecl = semanticModel1.GetDeclaredSymbol(localDecl);
Semantics\UnsafeTests.cs (5)
3494return ((ILocalSymbol)model.GetDeclaredSymbol(decl)).Type; 3553return ((ILocalSymbol)model.GetDeclaredSymbol(decl)).Type; 4436var declaredSymbol = model.GetDeclaredSymbol(syntax.Ancestors().OfType<VariableDeclaratorSyntax>().First()); 7340var declaredSymbols = declarators.Select(syntax => (ILocalSymbol)model.GetDeclaredSymbol(syntax)).ToArray(); 7389var declaredSymbols = declarators.Select(syntax => (ILocalSymbol)model.GetDeclaredSymbol(syntax)).ToArray();
Semantics\UsingStatementTests.cs (6)
62var declaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Single()); 1342var declaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Single()); 1377var firstDeclaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.First()); 1381var secondDeclaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Last()); 1388Assert.Equal(((ILocalSymbol)model.GetDeclaredSymbol(usingStatement.Declaration.Variables.First())).Type, typeInfo.Symbol); 1868var symbol = model.GetDeclaredSymbol(x);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (76)
Compilation\SemanticModelAPITests.cs (14)
210Assert.Same(model.GetDeclaredSymbol(rxDecl.Variables.Single()), rxSymbol); 257var symbol1 = model1.GetDeclaredSymbol(vardecl); 258var symbol2 = model2.GetDeclaredSymbol(vardecl); 277var symbol1 = model1.GetDeclaredSymbol(vardecl); 278var symbol2 = model2.GetDeclaredSymbol(vardecl); 1741var fieldSymbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables.Single()); 1787var local = speculativeModel.GetDeclaredSymbol(declarator); 1840var local = speculativeModel.GetDeclaredSymbol(declarator); 1853local = speculativeModel.GetDeclaredSymbol(declarator); 2284var symbol = speculativeModel.GetDeclaredSymbol(declarator); 2393var local = speculativeModel.GetDeclaredSymbol(declarator); 2576var local = speculativeModel.GetDeclaredSymbol(declarator); 2590local = speculativeModel.GetDeclaredSymbol(declarator); 2604local = speculativeModel.GetDeclaredSymbol(declarator);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (9)
62ISymbol rx = model.GetDeclaredSymbol(rxDecl.Variables.Single()); 409var eventSymbol = model.GetDeclaredSymbol(eventDecl.Declaration.Variables[0]); 570var symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[0]); 592var symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[0]); 596symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[1]); 778var symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]); 800var symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]); 804symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[1]); 949var fSymbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]) as IFieldSymbol;
DocumentationComments\DocumentationCommentIDTests.cs (1)
166var symbol = model.GetDeclaredSymbol(syntax);
SymbolDisplay\SymbolDisplayTests.cs (4)
6535var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(declarator); 6568var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(declarator); 6613var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(declarator); 8501var locals = decls.Select(d => model.GetDeclaredSymbol(d)).ToArray();
Symbols\AnonymousTypesSymbolTests.cs (2)
1689var localA3 = model.GetDeclaredSymbol(statement3.Declaration.Variables[0]) as ILocalSymbol; 1690var localA4 = model.GetDeclaredSymbol(statement4.Declaration.Variables[0]) as ILocalSymbol;
Symbols\ConversionTests.cs (1)
395ITypeSymbol targetType = ((ILocalSymbol)model.GetDeclaredSymbol(variableDeclarator)).Type;
Symbols\FunctionPointerTypeSymbolTests.cs (5)
1933Assert.Equal("delegate*<System.Int32> ptr1", model.GetDeclaredSymbol(decls[0]).ToTestDisplayString()); 1934Assert.Equal("delegate*<System.Int32> ptr2", model.GetDeclaredSymbol(decls[1]).ToTestDisplayString()); 1935Assert.Equal("delegate*<ref System.Int32, System.Void> ptr3", model.GetDeclaredSymbol(decls[2]).ToTestDisplayString()); 1936Assert.Equal("delegate*<System.Void, System.Void> ptr4", model.GetDeclaredSymbol(decls[3]).ToTestDisplayString()); 1937Assert.Equal("delegate*<ref System.Void> ptr5", model.GetDeclaredSymbol(decls[4]).ToTestDisplayString());
Symbols\Source\DeclaringSyntaxNodeTests.cs (4)
264var localA1 = (ILocalSymbol)model.GetDeclaredSymbol(declaratorA1); 309(ILocalSymbol)model.GetDeclaredSymbol(declaratorQ), 316(ILocalSymbol)model.GetDeclaredSymbol(declaratorX), 323(ILocalSymbol)model.GetDeclaredSymbol(declaratorZ),
Symbols\Source\NullablePublicAPITests.cs (17)
1003var localSymbol = (ILocalSymbol)model.GetDeclaredSymbol(v); 1175var declaredSymbol = (ILocalSymbol)context.SemanticModel.GetDeclaredSymbol(declarator); 1949var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 1996var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 2140Assert.Equal(PublicNullableAnnotation.Annotated, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).NullableAnnotation); 2141Assert.Equal(PublicNullableAnnotation.Annotated, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).Type.NullableAnnotation); 2144Assert.Equal(PublicNullableAnnotation.Annotated, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).NullableAnnotation); 2145Assert.Equal(PublicNullableAnnotation.Annotated, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).Type.NullableAnnotation); 2188var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 2220var symbol = (ILocalSymbol)model.GetDeclaredSymbol(declaration); 2258var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 2421var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 3858var o2Symbol = model.GetDeclaredSymbol(o2Declaration); 3881Assert.Equal(localFunctionSymbol, model.GetDeclaredSymbol(o8Declaration).ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3919var o2Symbol = (ILocalSymbol)model.GetDeclaredSymbol(o2Decl); 3933var o4Symbol = (ILocalSymbol)model.GetDeclaredSymbol(o4Decl); 4052var o2Symbol = model.GetDeclaredSymbol(o2Decl);
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (2)
38var local1 = model.GetDeclaredSymbol(varDeclarators.First()).GetSymbol<SourceLocalSymbol>(); 39var local2 = model.GetDeclaredSymbol(varDeclarators.ElementAt(1)).GetSymbol<SourceLocalSymbol>();
Symbols\SymbolEqualityTests.cs (16)
416var member1 = model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0]); 417var member2 = model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0]); 454var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 455var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 485var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 486var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 528var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 529var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 559var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 560var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 630var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 631var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 679var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 680var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 731var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 732var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type;
Symbols\TypeTests.cs (1)
1762var sym = model.GetDeclaredSymbol(node1.Declaration.Variables.First()) as ILocalSymbol;
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CastSimplifier.cs (1)
949var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
CSharpTypeInferenceService.TypeInferrer.cs (1)
2231var symbol = SemanticModel.GetDeclaredSymbol(variableDeclarator);
SemanticModelExtensions.cs (3)
228return semanticModel.GetDeclaredSymbol( 239return semanticModel.GetDeclaredSymbol( 298var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken);