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