1 type derived from Location
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
20 instantiations of Location
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Microsoft.CodeAnalysis.Razor.Workspaces (1)
Microsoft.CodeAnalysis.Remote.Razor (1)
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (2)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostGoToDefinitionEndpointTest.cs (1)
453new() {
Microsoft.VisualStudioCode.RazorExtension.UnitTests (2)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostGoToDefinitionEndpointTest.cs (1)
453new() {
471 references to Location
IdeBenchmarks (2)
Microsoft.AspNetCore.Razor.Microbenchmarks (1)
Microsoft.AspNetCore.Razor.Test.Common.Tooling (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (7)
Microsoft.CodeAnalysis.LanguageServer.Protocol (73)
Handler\Definitions\AbstractGoToDefinitionHandler.cs (6)
20internal abstract class AbstractGoToDefinitionHandler : ILspServiceDocumentRequestHandler<LSP.TextDocumentPositionParams, LSP.Location[]?>
36public abstract Task<LSP.Location[]?> HandleRequestAsync(TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken);
38protected async Task<LSP.Location[]?> GetDefinitionAsync(LSP.TextDocumentPositionParams request, bool forSymbolType, RequestContext context, CancellationToken cancellationToken)
50internal static async Task<LSP.Location[]?> GetDefinitionsAsync(IGlobalOptionService globalOptions, IMetadataAsSourceFileService? metadataAsSourceFileService, Workspace workspace, Document document, bool forSymbolType, LinePosition linePosition, CancellationToken cancellationToken)
52var locations = ArrayBuilder<LSP.Location>.GetInstance();
67var location = await ProtocolConversions.TextSpanToLocationAsync(
Handler\References\FindUsagesLSPContext.cs (11)
33private readonly IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> _progress;
55private readonly Dictionary<int, SumType<VSInternalReferenceItem, LSP.Location>> _definitionsWithoutReference = [];
72private readonly AsyncBatchingWorkQueue<SumType<VSInternalReferenceItem, LSP.Location>> _workQueue;
78IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> progress,
97_workQueue = new AsyncBatchingWorkQueue<SumType<VSInternalReferenceItem, LSP.Location>>(
182private async Task<SumType<VSInternalReferenceItem, LSP.Location>?> GenerateVSReferenceItemAsync(
199var location = await ComputeLocationAsync(documentSpan, cancellationToken).ConfigureAwait(false);
206private static SumType<VSInternalReferenceItem, LSP.Location>? CreateVsReference(
215LSP.Location? location)
249private async Task<LSP.Location?> ComputeLocationAsync(DocumentSpan? documentSpan, CancellationToken cancellationToken)
375private async ValueTask ReportReferencesAsync(ImmutableSegmentedList<SumType<VSInternalReferenceItem, LSP.Location>> referencesToReport, CancellationToken cancellationToken)
Protocol\Methods.Navigation.cs (9)
31public static readonly LspRequest<DeclarationParams, SumType<Location, Location[], LocationLink[]>?> TextDocumentDeclaration = new(TextDocumentDeclarationName);
50public static readonly LspRequest<DefinitionParams, SumType<Location, Location[], LocationLink[]>?> TextDocumentDefinition = new(TextDocumentDefinitionName);
69public static readonly LspRequest<TypeDefinitionParams, SumType<Location, Location[], LocationLink[]>?> TextDocumentTypeDefinition = new(TextDocumentTypeDefinitionName);
88public static readonly LspRequest<ImplementationParams, SumType<Location, Location[], LocationLink[]>?> TextDocumentImplementation = new(TextDocumentImplementationName);
104public static readonly LspRequest<ReferenceParams, Location[]?> TextDocumentReferences = new(TextDocumentReferencesName);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (170)
References\FindAllReferencesHandlerTests.cs (6)
457private static LSP.ReferenceParams CreateReferenceParams(LSP.Location caret, IProgress<object> progress, bool includeDeclaration)
466internal static async Task<LSP.VSInternalReferenceItem[]> RunFindAllReferencesAsync(TestLspServer testLspServer, LSP.Location caret, BufferedProgress<object>? progress = null, bool includeDeclaration = true)
483internal static async Task<LSP.Location[]> RunFindAllReferencesNonVSAsync(TestLspServer testLspServer, LSP.Location caret, BufferedProgress<object>? progress = null, bool includeDeclaration = true)
485var results = await testLspServer.ExecuteRequestAsync<LSP.ReferenceParams, LSP.Location[]>(LSP.Methods.TextDocumentReferencesName,
492results = [.. UnwrapProgress<LSP.Location>(progress.Value)];
Microsoft.CodeAnalysis.LanguageServer.UnitTests (12)
Microsoft.CodeAnalysis.Razor.Workspaces (14)
Microsoft.CodeAnalysis.Razor.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.Remote.Razor (22)
RemoteTagHelperSearchEngine.cs (4)
23public async Task<LspLocation[]?> TryLocateTagHelperDefinitionsAsync(ImmutableArray<BoundTagHelperResult> boundTagHelperResults, IDocumentSnapshot documentSnapshot, ISolutionQueryOperations solutionQueryOperations, CancellationToken cancellationToken)
34using var locations = new PooledArrayBuilder<LspLocation>();
43var location = await TryLocateTagHelperDefinitionAsync(boundTagHelper, boundAttribute, compilation, project.Solution, cancellationToken).ConfigureAwait(false);
53private async Task<LspLocation?> TryLocateTagHelperDefinitionAsync(TagHelperDescriptor boundTagHelper, BoundAttributeDescriptor? boundAttribute, Compilation compilation, Solution solution, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Microsoft.VisualStudio.LanguageServices.Razor (29)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\FindAllReferences\CohostFindAllReferencesEndpoint.cs (6)
26: AbstractCohostDocumentEndpoint<ReferenceParams, SumType<VSInternalReferenceItem, LspLocation>[]?>(incompatibleProjectService), IDynamicRegistrationProvider
51protected override Task<SumType<VSInternalReferenceItem, LspLocation>[]?> HandleRequestAsync(ReferenceParams request, TextDocument razorDocument, CancellationToken cancellationToken)
54private async Task<SumType<VSInternalReferenceItem, LspLocation>[]?> HandleRequestAsync(TextDocument razorDocument, Position position, CancellationToken cancellationToken)
57.TryInvokeAsync<IRemoteFindAllReferencesService, RemoteResponse<SumType<VSInternalReferenceItem, LspLocation>[]?>>(
64if (response.Result is SumType<VSInternalReferenceItem, LspLocation>[] results)
76public Task<SumType<VSInternalReferenceItem, LspLocation>[]?> HandleRequestAsync(TextDocument razorDocument, Position position, CancellationToken cancellationToken)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToDefinitionEndpoint.cs (13)
32: AbstractCohostDocumentEndpoint<TextDocumentPositionParams, SumType<LspLocation, LspLocation[], DocumentLink[]>?>(incompatibleProjectService), IDynamicRegistrationProvider
59protected override async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> HandleRequestAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
64.TryInvokeAsync<IRemoteGoToDefinitionService, RemoteResponse<LspLocation[]?>>(
71if (response.Result is LspLocation[] locations)
84private async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> GetHtmlDefinitionsAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
87.MakeHtmlLspRequestAsync<TextDocumentPositionParams, SumType<LspLocation, LspLocation[], DocumentLink[]>>(
99if (result.TryGetFirst(out var singleLocation))
139public Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> HandleRequestAsync(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToImplementationEndpoint.cs (9)
29: AbstractCohostDocumentEndpoint<TextDocumentPositionParams, SumType<LspLocation[], VSInternalReferenceItem[]>?>(incompatibleProjectService), IDynamicRegistrationProvider
56protected override async Task<SumType<LspLocation[], VSInternalReferenceItem[]>?> HandleRequestAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
61.TryInvokeAsync<IRemoteGoToImplementationService, RemoteResponse<LspLocation[]?>>(
68if (response.Result is LspLocation[] locations)
81private async Task<SumType<LspLocation[], VSInternalReferenceItem[]>?> GetHtmlImplementationsAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
84.MakeHtmlLspRequestAsync<TextDocumentPositionParams, SumType<LspLocation[], VSInternalReferenceItem[]>>(
98foreach (var location in locations)
118private void RemapVirtualHtmlUri(LspLocation? location)
131public Task<SumType<LspLocation[], VSInternalReferenceItem[]>?> HandleRequestAsync(
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (54)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostGoToDefinitionEndpointTest.cs (36)
80var location = Assert.Single(locations);
155var location = Assert.Single(locations);
190var location = Assert.Single(locations);
223var location = Assert.Single(locations);
256var location = Assert.Single(locations);
294var location = Assert.Single(locations);
336var location = Assert.Single(locations);
378var location = Assert.Single(locations);
426var location = Assert.Single(locations);
451var htmlResponse = new SumType<LspLocation, LspLocation[], DocumentLink[]>?(new LspLocation[]
489var location = Assert.Single(locations);
525var location = Assert.Single(locations);
569var location = Assert.Single(locations);
607var location = Assert.Single(locations);
652var location = Assert.Single(locations);
716var location = Assert.Single(locations);
780var location = Assert.Single(locations);
868var location = locations[0];
896var location = Assert.Single(locations);
920var location = Assert.Single(locations);
950var location = Assert.Single(locations);
973var location = Assert.Single(locations);
1028var location = Assert.Single(locations);
1039SumType<LspLocation, LspLocation[], DocumentLink[]>? htmlResponse = null,
1049var location = Assert.Single(locations);
1058private async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> GetGoToDefinitionResultAsync(
1061SumType<LspLocation, LspLocation[], DocumentLink[]>? htmlResponse = null,
1068private async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> GetGoToDefinitionResultCoreAsync(
1069TextDocument document, TestCode input, SumType<LspLocation, LspLocation[], DocumentLink[]>? htmlResponse)
Microsoft.VisualStudioCode.RazorExtension (29)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\FindAllReferences\CohostFindAllReferencesEndpoint.cs (6)
26: AbstractCohostDocumentEndpoint<ReferenceParams, SumType<VSInternalReferenceItem, LspLocation>[]?>(incompatibleProjectService), IDynamicRegistrationProvider
51protected override Task<SumType<VSInternalReferenceItem, LspLocation>[]?> HandleRequestAsync(ReferenceParams request, TextDocument razorDocument, CancellationToken cancellationToken)
54private async Task<SumType<VSInternalReferenceItem, LspLocation>[]?> HandleRequestAsync(TextDocument razorDocument, Position position, CancellationToken cancellationToken)
57.TryInvokeAsync<IRemoteFindAllReferencesService, RemoteResponse<SumType<VSInternalReferenceItem, LspLocation>[]?>>(
64if (response.Result is SumType<VSInternalReferenceItem, LspLocation>[] results)
76public Task<SumType<VSInternalReferenceItem, LspLocation>[]?> HandleRequestAsync(TextDocument razorDocument, Position position, CancellationToken cancellationToken)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToDefinitionEndpoint.cs (13)
32: AbstractCohostDocumentEndpoint<TextDocumentPositionParams, SumType<LspLocation, LspLocation[], DocumentLink[]>?>(incompatibleProjectService), IDynamicRegistrationProvider
59protected override async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> HandleRequestAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
64.TryInvokeAsync<IRemoteGoToDefinitionService, RemoteResponse<LspLocation[]?>>(
71if (response.Result is LspLocation[] locations)
84private async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> GetHtmlDefinitionsAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
87.MakeHtmlLspRequestAsync<TextDocumentPositionParams, SumType<LspLocation, LspLocation[], DocumentLink[]>>(
99if (result.TryGetFirst(out var singleLocation))
139public Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> HandleRequestAsync(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToImplementationEndpoint.cs (9)
29: AbstractCohostDocumentEndpoint<TextDocumentPositionParams, SumType<LspLocation[], VSInternalReferenceItem[]>?>(incompatibleProjectService), IDynamicRegistrationProvider
56protected override async Task<SumType<LspLocation[], VSInternalReferenceItem[]>?> HandleRequestAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
61.TryInvokeAsync<IRemoteGoToImplementationService, RemoteResponse<LspLocation[]?>>(
68if (response.Result is LspLocation[] locations)
81private async Task<SumType<LspLocation[], VSInternalReferenceItem[]>?> GetHtmlImplementationsAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken)
84.MakeHtmlLspRequestAsync<TextDocumentPositionParams, SumType<LspLocation[], VSInternalReferenceItem[]>>(
98foreach (var location in locations)
118private void RemapVirtualHtmlUri(LspLocation? location)
131public Task<SumType<LspLocation[], VSInternalReferenceItem[]>?> HandleRequestAsync(
Microsoft.VisualStudioCode.RazorExtension.UnitTests (53)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostGoToDefinitionEndpointTest.cs (36)
80var location = Assert.Single(locations);
155var location = Assert.Single(locations);
190var location = Assert.Single(locations);
223var location = Assert.Single(locations);
256var location = Assert.Single(locations);
294var location = Assert.Single(locations);
336var location = Assert.Single(locations);
378var location = Assert.Single(locations);
426var location = Assert.Single(locations);
451var htmlResponse = new SumType<LspLocation, LspLocation[], DocumentLink[]>?(new LspLocation[]
489var location = Assert.Single(locations);
525var location = Assert.Single(locations);
569var location = Assert.Single(locations);
607var location = Assert.Single(locations);
652var location = Assert.Single(locations);
716var location = Assert.Single(locations);
780var location = Assert.Single(locations);
868var location = locations[0];
896var location = Assert.Single(locations);
920var location = Assert.Single(locations);
950var location = Assert.Single(locations);
973var location = Assert.Single(locations);
1028var location = Assert.Single(locations);
1039SumType<LspLocation, LspLocation[], DocumentLink[]>? htmlResponse = null,
1049var location = Assert.Single(locations);
1058private async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> GetGoToDefinitionResultAsync(
1061SumType<LspLocation, LspLocation[], DocumentLink[]>? htmlResponse = null,
1068private async Task<SumType<LspLocation, LspLocation[], DocumentLink[]>?> GetGoToDefinitionResultCoreAsync(
1069TextDocument document, TestCode input, SumType<LspLocation, LspLocation[], DocumentLink[]>? htmlResponse)