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)
508 references to Locations
ILLink.RoslynAnalyzer (15)
DynamicallyAccessedMembersAnalyzer.cs (9)
123 var location = GetPrimaryLocation (type.Locations);
152 var location = GetPrimaryLocation (member.Locations);
186 Location attributableSymbolLocation = GetPrimaryLocation (attributableMethod.Locations);
197 GetPrimaryLocation (returnOrigin.Locations), sourceLocation, DAMArgs?.ToImmutableDictionary (), overrideMethod.GetDisplayName (), baseMethod.GetDisplayName ()));
219 GetPrimaryLocation (parameterOrigin?.Locations), sourceLocation, DAMArgs?.ToImmutableDictionary (),
232 Location attributableSymbolLocation = GetPrimaryLocation (attributableSymbol.Locations);
243 GetPrimaryLocation (typeParameterOrigin.Locations), sourceLocation, DAMArgs?.ToImmutableDictionary (),
256 GetPrimaryLocation (methodOrigin.Locations),
295 GetPrimaryLocation (propertySymbol.Locations),
Microsoft.Analyzers.Extra (1)
Microsoft.Analyzers.Local (7)
ApiLifecycle\ApiLifecycleAnalyzer.cs (7)
76context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.NewSymbolsMustBeMarkedExperimental, symbol.Locations.FirstOrDefault(), symbol));
113context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.ExperimentalSymbolsCantBeMarkedObsolete, symbol.Locations.FirstOrDefault(), symbol));
120context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantBeMarkedExperimental, symbol.Locations.FirstOrDefault(), symbol));
127context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantChange, symbol.Locations.FirstOrDefault(), symbol));
135context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantChange, symbol.Locations.FirstOrDefault(), symbol));
156context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.NewSymbolsMustBeMarkedExperimental, type.Locations.FirstOrDefault(), type));
160context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.ExperimentalSymbolsCantBeMarkedObsolete, type.Locations.FirstOrDefault(), type));
Microsoft.AspNetCore.Components.Analyzers (2)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
Microsoft.AspNetCore.Mvc.Analyzers (2)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (13)
Microsoft.CodeAnalysis (5)
Microsoft.CodeAnalysis.CodeStyle (28)
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (18)
CodeGen\CodeGenTupleTest.cs (18)
5883Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
5920Assert.Equal(loc1, tuple.GetMembers("i1").Single().Locations.Single());
5921Assert.Equal(loc2, tuple.GetMembers("i2").Single().Locations.Single());
5960Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
5979Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
5998Assert.All(tupleWithSomeNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6016Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6041Assert.All(tuple8WithoutNames.TupleElements.Select(f => f.Locations.FirstOrDefault()),
6068Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()),
6093Assert.All(tuple8WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6118Assert.All(tuple9WithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6144Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6176Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6200Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()),
6374Assert.True(tupleWithoutNames.GetMembers("Item1").Single().Locations.IsEmpty);
6399Assert.Equal(loc1, tuple.GetMembers("Item1").Single().Locations.Single());
6400Assert.Equal(loc2, tuple.GetMembers("Item2").Single().Locations.Single());
17376Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations[0]);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (6)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (45)
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
Microsoft.CodeAnalysis.EditorFeatures (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (17)
Microsoft.CodeAnalysis.Features (67)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Microsoft.CodeAnalysis.Test.Utilities (29)
Diagnostics\CommonDiagnosticAnalyzers.cs (21)
610codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockTopLevelRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name));
619codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockPerCompilationRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name));
766context.ReportDiagnostic(Diagnostic.Create(Rule, context.Symbol.Locations[0]));
798context.ReportDiagnostic(Diagnostic.Create(Rule, ns.Locations[0]));
1003symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0]));
1043symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name));
1177var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name);
1219var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0]);
1335blockStartContext.RegisterOperationBlockEndAction(c => ReportDiagnostic(c.ReportDiagnostic, c.OwningSymbol.Locations[0]));
1344ReportDiagnostic(blockContext.ReportDiagnostic, blockContext.OwningSymbol.Locations[0]);
1392var diagnostic = Diagnostic.Create(Descriptor, c.OwningSymbol.Locations[0], c.OwningSymbol.Name, operationRoot.Kind);
1660ReportDiagnosticsCore(addDiagnostic, symbol.Locations[0], symbol.Name);
1706var diagnostic = Diagnostic.Create(Rule, namedType.Locations[0], namedType.Name, namedTypes.Count);
1804foreach (var location in symbolContext.Symbol.Locations)
1814var diagnostic = Diagnostic.Create(descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name);
1864context.ReportDiagnostic(Diagnostic.Create(ParameterDescriptor, context.Symbol.Locations[0]));
2463=> reportDiagnostic(Diagnostic.Create(_rule, symbol.Locations[0], symbol.Name));
2542var diagnostic = Diagnostic.Create(Descriptor, context.Symbol.Locations[0], _reportedSeverity, additionalLocations: null, properties: null, messageArgs: null);
2570endContext => endContext.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.OwningSymbol.Locations[0])));
2610context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Symbol.Locations[0])),
2940context.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.CommandLine.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (49)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (47)
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,
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (6)
Microsoft.CodeAnalysis.Workspaces (60)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.Extensions.Logging.Generators (8)
LoggerMessageGenerator.Parser.cs (8)
374Diag(DiagnosticDescriptors.InvalidLoggingMethodParameterOut, paramSymbol.Locations[0], paramName);
402Diag(DiagnosticDescriptors.ShouldntMentionLoggerInMessage, paramSymbol.Locations[0], paramName);
407Diag(DiagnosticDescriptors.ShouldntMentionExceptionInMessage, paramSymbol.Locations[0], paramName);
412Diag(DiagnosticDescriptors.ShouldntMentionLogLevelInMessage, paramSymbol.Locations[0], paramName);
417Diag(DiagnosticDescriptors.ArgumentHasNoCorrespondingTemplate, paramSymbol.Locations[0], paramName);
421Diag(DiagnosticDescriptors.ArgumentHasNoCorrespondingTemplate, paramSymbol.Locations[0], paramName);
428Diag(DiagnosticDescriptors.InvalidLoggingMethodParameterName, paramSymbol.Locations[0]);
701Diag(DiagnosticDescriptors.PrimaryConstructorParameterLoggerHidden, parameter.Locations[0], classDec.Identifier.Text);
Microsoft.Extensions.Options.SourceGeneration (3)
Microsoft.Gen.ComplianceReports (3)
Microsoft.Gen.Logging (2)
Microsoft.Gen.Logging.Unit.Tests (3)
Microsoft.Gen.Metrics (10)
Parser.cs (8)
550Diag(DiagDescriptors.ErrorInvalidParameterName, paramSymbol.Locations[0]);
651strongTypeSymbol.Locations[0],
659Diag(DiagDescriptors.ErrorTooManyTagNames, strongTypeSymbol.Locations[0]);
734Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name);
766Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name);
809Diag(DiagDescriptors.ErrorInvalidTagNameType, member.Locations[0]);
818Diag(DiagDescriptors.ErrorInvalidTagNameType, member.Locations[0]);
839Diag(DiagDescriptors.ErrorInvalidTagNameType, member.Locations[0]);
Microsoft.Gen.MetricsReports (10)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (8)
550Diag(DiagDescriptors.ErrorInvalidParameterName, paramSymbol.Locations[0]);
651strongTypeSymbol.Locations[0],
659Diag(DiagDescriptors.ErrorTooManyTagNames, strongTypeSymbol.Locations[0]);
734Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name);
766Diag(DiagDescriptors.ErrorDuplicateTagName, member.Locations[0], member.Name);
809Diag(DiagDescriptors.ErrorInvalidTagNameType, member.Locations[0]);
818Diag(DiagDescriptors.ErrorInvalidTagNameType, member.Locations[0]);
839Diag(DiagDescriptors.ErrorInvalidTagNameType, member.Locations[0]);
Microsoft.Interop.ComInterfaceGenerator (5)
Microsoft.Interop.SourceGeneration (6)
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.ML.InternalCodeAnalyzer (3)
Microsoft.VisualStudio.LanguageServices (14)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Mvc.Api.Analyzers.Test (4)
System.Text.Json.SourceGeneration (2)
System.Windows.Forms.Analyzers.CSharp (1)
System.Windows.Forms.Analyzers.VisualBasic (1)