6 implementations of Locations
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (1)
533 references to Locations
Microsoft.CodeAnalysis (5)
Microsoft.CodeAnalysis.CodeStyle (31)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (19)
CodeGen\CodeGenTupleTest.cs (19)
5878Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
5915Assert.Equal(loc1, tuple.GetMembers("i1").Single().Locations.Single());
5916Assert.Equal(loc2, tuple.GetMembers("i2").Single().Locations.Single());
5955Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
5974Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
5993Assert.All(tupleWithSomeNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6011Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6036Assert.All(tuple8WithoutNames.TupleElements.Select(f => f.Locations.FirstOrDefault()),
6063Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()),
6088Assert.All(tuple8WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6113Assert.All(tuple9WithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6139Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6171Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6195Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6369Assert.True(tupleWithoutNames.GetMembers("Item1").Single().Locations.IsEmpty);
6394Assert.Equal(loc1, tuple.GetMembers("Item1").Single().Locations.Single());
6395Assert.Equal(loc2, tuple.GetMembers("Item2").Single().Locations.Single());
17382Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations[0]);
17417Assert.Equal(secondElement.GetLocation(), bobField.Locations[0]);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (6)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (49)
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
Microsoft.CodeAnalysis.EditorFeatures (4)
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (25)
Microsoft.CodeAnalysis.Features (88)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (2)
Microsoft.CodeAnalysis.Test.Utilities (29)
Diagnostics\CommonDiagnosticAnalyzers.cs (21)
524codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockTopLevelRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name));
533codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockPerCompilationRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name));
680context.ReportDiagnostic(Diagnostic.Create(Rule, context.Symbol.Locations[0]));
712context.ReportDiagnostic(Diagnostic.Create(Rule, ns.Locations[0]));
917symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0]));
957symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name));
1067var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name);
1109var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0]);
1225blockStartContext.RegisterOperationBlockEndAction(c => ReportDiagnostic(c.ReportDiagnostic, c.OwningSymbol.Locations[0]));
1234ReportDiagnostic(blockContext.ReportDiagnostic, blockContext.OwningSymbol.Locations[0]);
1282var diagnostic = Diagnostic.Create(Descriptor, c.OwningSymbol.Locations[0], c.OwningSymbol.Name, operationRoot.Kind);
1550ReportDiagnosticsCore(addDiagnostic, symbol.Locations[0], symbol.Name);
1596var diagnostic = Diagnostic.Create(Rule, namedType.Locations[0], namedType.Name, namedTypes.Count);
1694foreach (var location in symbolContext.Symbol.Locations)
1704var diagnostic = Diagnostic.Create(descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name);
1754context.ReportDiagnostic(Diagnostic.Create(ParameterDescriptor, context.Symbol.Locations[0]));
2317=> reportDiagnostic(Diagnostic.Create(_rule, symbol.Locations[0], symbol.Name));
2372context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Symbol.Locations[0]));
2399endContext => endContext.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.OwningSymbol.Locations[0])));
2439context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Symbol.Locations[0])),
2614context.RegisterSymbolAction(context => HandleCallback(context.Symbol.Locations[0], context.Compilation, context.ReportDiagnostic, context.CancellationToken), SymbolKind.NamedType);
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (16)
CodeGen\CodeGenTuples.vb (16)
6899Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
6932Assert.Equal(loc1, tuple.GetMembers("i1").Single.Locations.Single())
6933Assert.Equal(loc2, tuple.GetMembers("i2").Single.Locations.Single())
6952Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
6972Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
6993Assert.All(tupleWithSomeNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7011Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7036Assert.All(tuple8WithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7061Assert.All(tuple8WithNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7086Assert.All(tuple9WithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7111Assert.All(tuple9WithNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7136Assert.All(tuple9WithNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7160Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
7283Assert.Equal(loc1, tuple.GetMembers("i1").Single().Locations.Single())
7284Assert.Equal(loc2, tuple.GetMembers("i2").Single().Locations.Single())
9042Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations(0)) ' Incorrect location
Microsoft.CodeAnalysis.VisualBasic.Features (8)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (89)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (49)
1258paramSymbol1.Locations.Single().SourceSpan.Start)
1266paramSymbol2.Locations.Single().SourceSpan.Start - "Optional ".Length)
1274paramSymbol3.Locations.Single().SourceSpan.Start)
1282paramSymbol4.Locations.Single().SourceSpan.Start)
1290paramSymbol5.Locations.Single().SourceSpan.Start)
1369Assert.Equal(syntax.SpanStart + 6, paramSymbol1.Locations.Single().SourceSpan.Start)
1374Assert.Equal(syntax.SpanStart + 6, paramSymbol2.Locations.Single().SourceSpan.Start)
1379Assert.Equal(syntax.SpanStart, paramSymbol3.Locations.Single().SourceSpan.Start)
1384Assert.Equal(syntax.SpanStart + 6, paramSymbol4.Locations.Single().SourceSpan.Start)
1848Assert.Equal(2, tpSymbol1.Locations.Length())
1849Assert.True(syntax.SpanStart = tpSymbol1.Locations.Item(0).SourceSpan.Start OrElse
1850syntax.SpanStart = tpSymbol1.Locations.Item(1).SourceSpan.Start,
1857Assert.Equal(2, tpSymbol2.Locations.Length())
1858Assert.True(syntax.SpanStart = tpSymbol2.Locations.Item(0).SourceSpan.Start OrElse
1859syntax.SpanStart = tpSymbol2.Locations.Item(1).SourceSpan.Start,
1866Assert.Equal(2, tpSymbol3.Locations.Length())
1867Assert.True(syntax.SpanStart = tpSymbol3.Locations.Item(0).SourceSpan.Start OrElse
1868syntax.SpanStart = tpSymbol3.Locations.Item(1).SourceSpan.Start,
1875Assert.Equal(2, tpSymbol4.Locations.Length())
1876Assert.True(syntax.SpanStart = tpSymbol4.Locations.Item(0).SourceSpan.Start OrElse
1877syntax.SpanStart = tpSymbol4.Locations.Item(1).SourceSpan.Start,
1884Assert.Equal(1, tpSymbol5.Locations.Length())
1885Assert.Equal(syntax.SpanStart, tpSymbol5.Locations.Single().SourceSpan.Start)
2021Assert.Equal(1, varSymbol1.Locations.Length())
2022Assert.True(syntax.SpanStart = varSymbol1.Locations.Item(0).SourceSpan.Start OrElse
2023syntax.SpanStart = varSymbol1.Locations.Item(1).SourceSpan.Start,
2031Assert.Equal(1, varSymbol2.Locations.Length())
2032Assert.True(syntax.SpanStart = varSymbol2.Locations.Item(0).SourceSpan.Start OrElse
2033syntax.SpanStart = varSymbol2.Locations.Item(1).SourceSpan.Start,
2041Assert.Equal(1, varSymbol3.Locations.Length())
2042Assert.True(syntax.SpanStart = varSymbol3.Locations.Item(0).SourceSpan.Start OrElse
2043syntax.SpanStart = varSymbol3.Locations.Item(1).SourceSpan.Start,
2051Assert.Equal(1, varSymbol4.Locations.Length())
2052Assert.True(syntax.SpanStart = varSymbol4.Locations.Item(0).SourceSpan.Start OrElse
2053syntax.SpanStart = varSymbol4.Locations.Item(1).SourceSpan.Start,
2061Assert.Equal(1, varSymbol5.Locations.Length())
2062Assert.True(syntax.SpanStart = varSymbol5.Locations.Item(0).SourceSpan.Start OrElse
2063syntax.SpanStart = varSymbol5.Locations.Item(1).SourceSpan.Start,
2071Assert.Equal(1, varSymbol6.Locations.Length())
2072Assert.True(syntax.SpanStart = varSymbol6.Locations.Item(0).SourceSpan.Start OrElse
2073syntax.SpanStart = varSymbol6.Locations.Item(1).SourceSpan.Start,
2082Assert.Equal(1, varSymbol7.Locations.Length())
2083Assert.True(syntax.SpanStart = varSymbol7.Locations.Item(0).SourceSpan.Start OrElse
2084syntax.SpanStart = varSymbol7.Locations.Item(1).SourceSpan.Start,
2092Assert.Equal(1, varSymbol8.Locations.Length())
2093Assert.True(syntax.SpanStart = varSymbol8.Locations.Item(0).SourceSpan.Start OrElse
2094syntax.SpanStart = varSymbol8.Locations.Item(1).SourceSpan.Start,
2615Assert.Equal(3, nsSymbolA.Locations.Length)
2627Assert.Equal(nsSymbolA.Locations.Length, memSymbol.Locations.Length)
Semantics\PartialMethodsTest.vb (25)
69Assert.Equal(2, ptSym01.Locations.Length)
82Assert.Equal(1, pmSym01.Locations.Length)
83Assert.Equal(1, pmSym02.Locations.Length)
92Assert.Equal(1, ppSym01.Locations.Length)
93Assert.Equal(1, ppSym02.Locations.Length)
149Assert.Equal(2, ptSym01.Locations.Length)
162Assert.Equal(1, pmSym01.Locations.Length)
163Assert.Equal(1, pmSym02.Locations.Length)
172Assert.Equal(1, ppSym01.Locations.Length)
173Assert.Equal(1, ppSym02.Locations.Length)
231Assert.Equal(2, ptSym01.Locations.Length)
244Assert.Equal(1, pmSym01.Locations.Length)
245Assert.Equal(1, pmSym02.Locations.Length)
254Assert.Equal(1, ppSym01.Locations.Length)
255Assert.Equal(1, ppSym02.Locations.Length)
387Assert.Equal(1, pmSym01.Locations.Length)
388Assert.Equal(1, pmSym02.Locations.Length)
1055Assert.NotEqual(paraSym1.Locations(0), paraSym2.Locations(0))
1065Assert.NotEqual(typeParaSym1.Locations(0), typeParaSym2.Locations(0))
1111Assert.NotEqual(paraSym1.Locations(0), paraSym2.Locations(0))
1121Assert.NotEqual(typeParaSym1.Locations(0), typeParaSym2.Locations(0))
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (17)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (12)
56Assert.Equal(1, info0.Type.Locations.Length)
57Assert.Equal(info0.Type.Locations(0).SourceSpan, tree.FindNodeOrTokenByKind(SyntaxKind.NewKeyword, 1).Span)
60Assert.Equal(1, info1.Type.Locations.Length)
61Assert.Equal(info1.Type.Locations(0).SourceSpan, tree.FindNodeOrTokenByKind(SyntaxKind.NewKeyword, 3).Span)
64Assert.Equal(1, info2.Type.Locations.Length)
65Assert.Equal(info2.Type.Locations(0).SourceSpan, tree.FindNodeOrTokenByKind(SyntaxKind.NewKeyword, 5).Span)
508Assert.Equal(1, info0.Type.Locations.Length)
509Assert.Equal(info0.Type.Locations(0).SourceSpan, tree.FindNodeOrTokenByKind(SyntaxKind.NewKeyword, 1).Span)
512Assert.Equal(1, info1.Type.Locations.Length)
513Assert.Equal(info1.Type.Locations(0).SourceSpan, tree.FindNodeOrTokenByKind(SyntaxKind.NewKeyword, 2).Span)
516Assert.Equal(1, info2.Type.Locations.Length)
517Assert.Equal(info2.Type.Locations(0).SourceSpan, tree.FindNodeOrTokenByKind(SyntaxKind.NewKeyword, 4).Span)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (8)
Microsoft.CodeAnalysis.Workspaces (60)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Microsoft.VisualStudio.LanguageServices (15)
Microsoft.VisualStudio.LanguageServices.Implementation (5)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)