47 references to Locations
IdeCoreBenchmarks (1)
FindReferencesBenchmarks.cs (1)
112var locations = refList.SelectMany(r => r.Locations).ToList();
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
146document.Project.Solution, referencedSymbol.Locations.ToImmutableArray(), cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
923referencedSymbols.Single().Locations.IsEmpty();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
98var references = findReferencesList[0].Locations.ToList();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
478var referenceLocations = symbolReferences.SelectMany(reference => reference.Locations);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
130foreach (var location in referencedSymbol.Locations)
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
478var referenceLocations = symbolReferences.SelectMany(reference => reference.Locations);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
130foreach (var location in referencedSymbol.Locations)
Microsoft.CodeAnalysis.Features (8)
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
255foreach (var referenceLocation in reference.Locations)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
448.SelectMany(@ref => @ref.Locations)
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
282.SelectMany(referencedSymbol => referencedSymbol.Locations)
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
93if (referencedSymbol?.Locations != null) 95foreach (var location in referencedSymbol.Locations)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
173var getReferencesByDocument = getMethodReferences.SelectMany(r => r.Locations).ToLookup(loc => loc.Document);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
97from loc in r.Locations
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
923referencedSymbols.Single().Locations.IsEmpty();
Microsoft.CodeAnalysis.Workspaces (6)
FindSymbols\ReferencedSymbol.cs (2)
32/// Same as <see cref="Locations"/> but exposed as an <see cref="ImmutableArray{T}"/> for performance. 51var count = this.Locations.Count();
FindSymbols\SymbolFinder_Callers.cs (1)
67var result = await reference.Locations.FindReferencingSymbolsAsync(cancellationToken).ConfigureAwait(false);
Shared\Extensions\IFindReferencesResultExtensions.cs (2)
37if (referencedSymbol.Locations.Any()) 106let aliasLocations = r.Locations.Where(loc => SymbolEquivalenceComparer.Instance.Equals(loc.Alias, aliasSymbol)).ToImmutableArray()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
98var references = findReferencesList[0].Locations.ToList();
Microsoft.CodeAnalysis.Workspaces.UnitTests (23)
FindReferencesTests.cs (23)
108Assert.Equal(3, result[0].Locations.Count()); // 3 locations found 135Assert.Equal(1, typeSymbol.Locations.Count()); 189Assert.Equal(expected: 2, actual: references.ElementAt(0).Locations.Count()); 194Assert.Equal(expected: 2, actual: references.ElementAt(0).Locations.Count()); 226Assert.Equal(expected: 0, actual: references.ElementAt(0).Locations.Count()); 293Assert.Equal(2, references.ElementAt(0).Locations.Count()); 298Assert.Equal(2, references.ElementAt(0).Locations.Count()); 551Assert.Equal(1, typeResult.Locations.Count()); 552Assert.Equal(1, constructorResult.Locations.Count()); 555Assert.NotEqual(typeResult.Locations.Single().Location.SourceSpan, constructorResult.Locations.Single().Location.SourceSpan); 584Assert.Equal(1, typeResult.Locations.Count()); 585Assert.Equal(1, constructorResult.Locations.Count()); 588Assert.NotEqual(typeResult.Locations.Single().Location.SourceSpan, constructorResult.Locations.Single().Location.SourceSpan); 626Assert.Equal(2, typeResult.Locations.Count()); 627Assert.Equal(1, constructorResult.Locations.Count()); 630Assert.True(typeResult.Locations.All(loc => loc.Location.SourceSpan != constructorResult.Locations.Single().Location.SourceSpan)); 633Assert.NotNull(constructorResult.Locations.Single().Alias); 636Assert.True(typeResult.Locations.Count(loc => loc.Alias == null) == 1); 637Assert.True(typeResult.Locations.Count(loc => loc.Alias != null) == 1); 648foreach (var location in reference.Locations)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
284foreach (ReferenceLocation location in referencedSymbol.Locations)
Microsoft.VisualStudio.LanguageServices (1)
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
34var allLocations = referencedSymbol.Locations.Concat(reference.Locations.Select(r => r.Location))