140 references to GetDeclaredSymbol
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
504return semanticModel.GetDeclaredSymbol(syntax, cancellationToken)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
196var localSymbol = semanticModel.GetDeclaredSymbol(singleVariableDesignation, cancellationToken);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (38)
CodeGen\CodeGenDeconstructTests.cs (38)
3579var symbol = model.GetDeclaredSymbol(decl); 3611var field = (IFieldSymbol)model.GetDeclaredSymbol(decl); 4135var symbol = model.GetDeclaredSymbol(x1); 5022var xSymbol = model.GetDeclaredSymbol(x); 5028var ySymbol = model.GetDeclaredSymbol(y); 5174var x1Symbol = model.GetDeclaredSymbol(x1); 5180var x2Symbol = model.GetDeclaredSymbol(x2); 5311var x1Symbol = model.GetDeclaredSymbol(x1); 5316var x2Symbol = model.GetDeclaredSymbol(x2); 5347var x1Symbol = model.GetDeclaredSymbol(x1); 5352var x2Symbol = model.GetDeclaredSymbol(x2); 5402var xSymbol = model.GetDeclaredSymbol(x); 5409var ySymbol = model.GetDeclaredSymbol(y); 5435var xSymbol = model.GetDeclaredSymbol(x); 5442var ySymbol = model.GetDeclaredSymbol(y); 5478var secondX1Symbol = model.GetDeclaredSymbol(secondX1); 5505var firstYSymbol = model.GetDeclaredSymbol(firstY); 5510var secondYSymbol = model.GetDeclaredSymbol(secondY); 5536var firstXSymbol = model.GetDeclaredSymbol(firstX); 5541var secondXSymbol = model.GetDeclaredSymbol(secondX); 5565var xSymbol = model.GetDeclaredSymbol(x); 5605var xSymbol = model.GetDeclaredSymbol(x); 5615var ySymbol = model.GetDeclaredSymbol(y); 5644var x1Symbol = model.GetDeclaredSymbol(x1); 5653var x2Symbol = model.GetDeclaredSymbol(x2); 5688var x1Symbol = model.GetDeclaredSymbol(x1); 5697var x2Symbol = model.GetDeclaredSymbol(x2); 5727var x1Symbol = model.GetDeclaredSymbol(x1); 5733var x3Symbol = model.GetDeclaredSymbol(x3); 5769var x1Symbol = model.GetDeclaredSymbol(x1); 5775var x3Symbol = model.GetDeclaredSymbol(x3); 5805var x1Symbol = model.GetDeclaredSymbol(x1); 5811var x3Symbol = model.GetDeclaredSymbol(x3); 5855var x1Symbol = model.GetDeclaredSymbol(x1); 5862var x3Symbol = model.GetDeclaredSymbol(x3); 7235Assert.Equal(symbolInfo.Symbol, model.GetDeclaredSymbol(x1)); 7510Assert.Equal(xSymbolInfo.Symbol, model.GetDeclaredSymbol(x)); 7517Assert.Equal(zSymbolInfo.Symbol, model.GetDeclaredSymbol(z));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (51)
Semantics\OutVarTests.cs (32)
965var symbol = model.GetDeclaredSymbol(variableDeclaratorSyntax); 1140var symbol = model.GetDeclaredSymbol(variableDesignationSyntax); 5756Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(GetVariableDesignation(x1Decl))).Type.ToTestDisplayString()); 10270Assert.Equal("System.Boolean d", model.GetDeclaredSymbol(d).ToTestDisplayString()); 12875Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(GetVariableDesignation(yDecl))).Type.ToTestDisplayString()); 18036Assert.Equal("Cls.var", ((ILocalSymbol)model.GetDeclaredSymbol(GetVariableDesignation(x1Decl))).Type.ToTestDisplayString()); 18149Assert.Equal("System.Int32 x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 18190Assert.Equal("System.Int32 x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 18233Assert.Equal("System.Int32 x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 18276Assert.Equal("System.Int32 x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 18315Assert.Equal("var x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 18391Assert.Equal("var x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 18436Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(GetVariableDesignation(x1Decl))).Type.ToTestDisplayString()); 18500Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(GetVariableDesignation(x1Decl))).Type.ToTestDisplayString()); 18549Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(GetVariableDesignation(x1Decl))).Type.ToTestDisplayString()); 18594Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(GetVariableDesignation(x1Decl))).Type.ToTestDisplayString()); 19295Assert.Equal("dynamic x1", model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)).ToTestDisplayString()); 20224var x1 = (ILocalSymbol)model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)); 20253var x1 = (ILocalSymbol)model.GetDeclaredSymbol(GetVariableDesignation(x1Decl)); 22701Assert.Null(model.GetDeclaredSymbol(variableDeclaratorSyntax)); 26431Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl.VariableDesignation())).Type.ToTestDisplayString()); 27028Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl.VariableDesignation())).Type.ToTestDisplayString()); 32202var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32243var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32283var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32323var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32331x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32369var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32389x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32438var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32488var x1 = (IFieldSymbol)model.GetDeclaredSymbol(x1Decl.VariableDesignation()); 32732var symbol = model.GetDeclaredSymbol(variableDesignationSyntax);
Semantics\PatternMatchingTestBase.cs (7)
80var symbol = model.GetDeclaredSymbol(designation); 141var symbol = model.GetDeclaredSymbol(designation); 181var symbol = model.GetDeclaredSymbol(designation); 243var symbol = model.GetDeclaredSymbol(designation); 374Assert.Null(model.GetDeclaredSymbol(designation)); 381Assert.Null(model.GetDeclaredSymbol(designation)); 383var symbol = (ISymbol)model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests.cs (2)
1161Assert.Equal("System.Int32", ((ILocalSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl[0])).Type.ToTestDisplayString()); 11390var types = locals.Select(local => ((ILocalSymbol)model.GetDeclaredSymbol(local)).Type.ToTestDisplayString()).ToArray();
Semantics\PatternMatchingTests_Global.cs (2)
901Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl)).Type.ToTestDisplayString()); 1459Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl)).Type.ToTestDisplayString());
Semantics\PatternMatchingTests_ListPatterns.cs (2)
3725var symbol = model.GetDeclaredSymbol(itemDesignation); 3740symbol = model.GetDeclaredSymbol(sliceDesignation);
Semantics\PatternMatchingTests_Scope.cs (2)
6937Assert.Equal("System.Boolean d", model.GetDeclaredSymbol(d).ToTestDisplayString()); 13827var x1 = (ILocalSymbol)model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests2.cs (1)
723var symbol = model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests4.cs (1)
4830Assert.Equal("A? x", model.GetDeclaredSymbol(x).ToTestDisplayString());
Semantics\PrimaryConstructorTests.cs (1)
963var outVar = model.GetDeclaredSymbol(outVarSyntax);
Semantics\RecordTests.cs (1)
471var outVar = model.GetDeclaredSymbol(outVarSyntax)!;
Microsoft.CodeAnalysis.CSharp.Features (2)
InlineHints\CSharpInlineTypeHintsService.cs (1)
53var local = semanticModel.GetDeclaredSymbol(variableDesignation, cancellationToken) as ILocalSymbol;
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
196var localSymbol = semanticModel.GetDeclaredSymbol(singleVariableDesignation, cancellationToken);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (39)
Semantics\DeconstructionTests.cs (26)
4173var x1 = model.GetDeclaredSymbol(designations[0]); 4178var x2 = model.GetDeclaredSymbol(designations[1]); 4240var a = model.GetDeclaredSymbol(designations[0]); 4244var b = model.GetDeclaredSymbol(designations[1]); 4248var c = model.GetDeclaredSymbol(designations[2]); 4252var d = model.GetDeclaredSymbol(designations[3]); 4375var a = model.GetDeclaredSymbol(designations[0]); 4379var b = model.GetDeclaredSymbol(designations[1]); 4383var c = model.GetDeclaredSymbol(designations[2]); 4387var d = model.GetDeclaredSymbol(designations[3]); 5189var a = model.GetDeclaredSymbol(designations[0]); 5193var b = model.GetDeclaredSymbol(designations[1]); 5197var c = model.GetDeclaredSymbol(designations[2]); 5201var d = model.GetDeclaredSymbol(designations[3]); 5333var a = model.GetDeclaredSymbol(designations[0]); 5337var b = model.GetDeclaredSymbol(designations[1]); 5341var c = model.GetDeclaredSymbol(designations[2]); 5345var d = model.GetDeclaredSymbol(designations[3]); 5657var a = model.GetDeclaredSymbol(designations[0]); 5661var b = model.GetDeclaredSymbol(designations[1]); 5665var c = model.GetDeclaredSymbol(designations[2]); 5669var d = model.GetDeclaredSymbol(designations[3]); 5767var a = model.GetDeclaredSymbol(designations[0]); 5771var b = model.GetDeclaredSymbol(designations[1]); 5775var c = model.GetDeclaredSymbol(designations[2]); 5779var d = model.GetDeclaredSymbol(designations[3]);
Semantics\LocalFunctionTests.cs (1)
4693var symbol = (ILocalSymbol)model.GetDeclaredSymbol(designation);
Semantics\RecordStructTests.cs (1)
5964var outVar = model.GetDeclaredSymbol(outVarSyntax)!;
Semantics\RefFieldTests.cs (9)
12861var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13049var f = model.GetDeclaredSymbol(decl).GetSymbol<FieldSymbol>(); 13333var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13376var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13450var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13472var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 13647var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<SourceLocalSymbol>()).ToArray(); 13718var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray(); 14911var locals = decls.Select(d => model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>()).ToArray();
Semantics\RefLocalsAndReturnsTests.cs (2)
5260var f = model.GetDeclaredSymbol(decl).GetSymbol<FieldSymbol>(); 5299var f = model.GetDeclaredSymbol(decl).GetSymbol<FieldSymbol>();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Symbols\Source\NullablePublicAPITests.cs (6)
2056var symbols = variable.DescendantNodes().OfType<SingleVariableDesignationSyntax>().Select(s => model.GetDeclaredSymbol(s)).Cast<ILocalSymbol>().ToList(); 2099var symbols = variable.DescendantNodes().OfType<SingleVariableDesignationSyntax>().Select(s => model.GetDeclaredSymbol(s)).Cast<ILocalSymbol>().ToList(); 2289var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 2335var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 2377var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable); 2559var symbol = (ILocalSymbol)model.GetDeclaredSymbol(variable);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
504return semanticModel.GetDeclaredSymbol(syntax, cancellationToken)
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
504return semanticModel.GetDeclaredSymbol(syntax, cancellationToken)