1 type derived from Location
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Protocol\Extensions\VSLocation.cs (1)
12internal class VSLocation : Location
17 instantiations of Location
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Extensions\ProtocolConversions.cs (2)
499return new LSP.Location 529var location = new LSP.Location
Extensions\ProtocolConversions.Diagnostics.cs (1)
92Location = new LSP.Location
Handler\Definitions\AbstractGoToDefinitionHandler.cs (1)
89locations.Add(new LSP.Location
Handler\References\FindUsagesLSPContext.cs (1)
283return new LSP.Location
Handler\Symbols\DocumentSymbolsHandler.cs (1)
95var location = new LSP.Location()
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Definitions\GoToDefinitionTests.cs (1)
95var results = await RunGotoDefinitionAsync(testLspServer, new LSP.Location
Metadata\LspMetadataAsSourceWorkspaceTests.cs (1)
103var locationOfStringKeyword = new LSP.Location
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (2)
76var caret = new LSP.Location { Range = new() { Start = new(0, 6), End = new(0, 7) }, DocumentUri = looseFileUri }; 295CreateTextDocumentPositionParams(new LSP.Location
References\FindImplementationsTests.cs (1)
97var results = await RunFindImplementationAsync(testLspServer, new LSP.Location
Rename\RenameTests.cs (1)
175var renameParams = CreateRenameParams(new LSP.Location
Workspaces\SourceGeneratedDocumentTests.cs (1)
94var location = new LSP.Location { DocumentUri = sourceGeneratorDocumentUri, Range = new LSP.Range { Start = new LSP.Position(0, 6), End = new LSP.Position(0, 6) } };
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Utilities\AbstractLanguageServerClientTests.cs (1)
112var location = new LSP.Location
Microsoft.VisualStudio.LanguageServices.Xaml (3)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (3)
133return new LSP.Location 145return new LSP.Location 183locations.Add(new LSP.Location
248 references to Location
IdeBenchmarks (1)
Lsp\LspCompletionSerializationBenchmarks.cs (1)
105var caret = testServer.GetLocations("caret").Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
LanguageServer\VSTypeScriptHandlerTests.cs (1)
112public VSTypeScriptTestLspServer(LspTestWorkspace testWorkspace, Dictionary<string, IList<Roslyn.LanguageServer.Protocol.Location>> locations, InitializationOptions options, AbstractLspLogger logger) : base(testWorkspace, locations, options, logger)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (7)
Cohost\Handlers\FindAllReferences.cs (3)
16using Location = Roslyn.LanguageServer.Protocol.Location; 20public static async Task<SumType<VSInternalReferenceItem, Location>[]?> FindReferencesAsync(Workspace workspace, Document document, LinePosition linePosition, bool supportsVSExtensions, CancellationToken cancellationToken) 26var progress = BufferedProgress.Create<SumType<VSInternalReferenceItem, Location>[]>(progress: null);
Cohost\Handlers\GoToDefinition.cs (2)
14using Location = Roslyn.LanguageServer.Protocol.Location; 18public static Task<Location[]?> GetDefinitionsAsync(Workspace workspace, Document document, bool typeOnly, LinePosition linePosition, CancellationToken cancellationToken)
Cohost\Handlers\GoToImplementation.cs (2)
14using Location = Roslyn.LanguageServer.Protocol.Location; 18public static Task<Location[]> FindImplementationsAsync(Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (74)
Extensions\ProtocolConversions.cs (7)
371public static Task<LSP.Location?> DocumentSpanToLocationAsync(DocumentSpan documentSpan, CancellationToken cancellationToken) 377var location = await TextSpanToLocationAsync( 457public static Task<LSP.Location?> TextSpanToLocationAsync( 466public static async Task<LSP.Location?> TextSpanToLocationAsync( 505static async Task<LSP.Location> ConvertTextSpanToLocationAsync( 527static LSP.Location ConvertTextSpanWithTextToLocation(TextSpan span, SourceText text, DocumentUri documentUri) 529var location = new LSP.Location
Handler\Definitions\AbstractGoToDefinitionHandler.cs (7)
20internal abstract class AbstractGoToDefinitionHandler : ILspServiceDocumentRequestHandler<LSP.TextDocumentPositionParams, LSP.Location[]?> 36public abstract Task<LSP.Location[]?> HandleRequestAsync(TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken); 38protected Task<LSP.Location[]?> GetDefinitionAsync(LSP.TextDocumentPositionParams request, bool forSymbolType, RequestContext context, CancellationToken cancellationToken) 43return SpecializedTasks.Null<LSP.Location[]>(); 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\Definitions\GoToDefinitionHandler.cs (1)
27public override Task<LSP.Location[]?> HandleRequestAsync(LSP.TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken)
Handler\Definitions\GoToTypeDefinitionHandler.cs (1)
27public override Task<LSP.Location[]?> HandleRequestAsync(LSP.TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken)
Handler\MapCode\MapCodeHandler.cs (2)
116Document document, TextDocumentIdentifier textDocumentIdentifier, LSP.Location[][]? focusLocations, CancellationToken cancellationToken) 125foreach (var location in locationsOfSamePriority)
Handler\References\FindAllReferencesHandler.cs (3)
25internal sealed class FindAllReferencesHandler : ILspServiceDocumentRequestHandler<VSInternalReferenceParams, LSP.SumType<VSInternalReferenceItem, LSP.Location>[]?> 48public async Task<SumType<VSInternalReferenceItem, LSP.Location>[]?> HandleRequestAsync( 69IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> progress,
Handler\References\FindImplementationsHandler.cs (4)
21internal sealed class FindImplementationsHandler : ILspServiceDocumentRequestHandler<LSP.TextDocumentPositionParams, LSP.Location[]> 37public Task<LSP.Location[]> HandleRequestAsync(LSP.TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken) 47internal static async Task<LSP.Location[]> FindImplementationsAsync(Document document, LinePosition linePosition, OptionsProvider<ClassificationOptions> classificationOptions, bool supportsVisualStudioExtensions, CancellationToken cancellationToken) 49var locations = ArrayBuilder<LSP.Location>.GetInstance();
Handler\References\FindUsagesLSPContext.cs (11)
33private readonly IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> _progress; 54private readonly Dictionary<int, SumType<VSInternalReferenceItem, LSP.Location>> _definitionsWithoutReference = []; 71private readonly AsyncBatchingWorkQueue<SumType<VSInternalReferenceItem, LSP.Location>> _workQueue; 77IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> progress, 94_workQueue = new AsyncBatchingWorkQueue<SumType<VSInternalReferenceItem, LSP.Location>>( 178private async Task<SumType<VSInternalReferenceItem, LSP.Location>?> GenerateVSReferenceItemAsync( 195var location = await ComputeLocationAsync(documentSpan, cancellationToken).ConfigureAwait(false); 202private static SumType<VSInternalReferenceItem, LSP.Location>? CreateVsReference( 211LSP.Location? location) 245private async Task<LSP.Location?> ComputeLocationAsync(DocumentSpan? documentSpan, CancellationToken cancellationToken) 371private ValueTask ReportReferencesAsync(ImmutableSegmentedList<SumType<VSInternalReferenceItem, LSP.Location>> referencesToReport, CancellationToken cancellationToken)
Handler\Symbols\DocumentSymbolsHandler.cs (1)
95var location = new LSP.Location()
Handler\Symbols\SymbolInformationFactory.cs (1)
12public static SymbolInformation Create(string name, string? containerName, LSP.SymbolKind kind, LSP.Location location, Glyph glyph, bool supportsVSExtensions)
Handler\Symbols\WorkspaceSymbolsHandler.cs (1)
89var location = await ProtocolConversions.TextSpanToLocationAsync(
Protocol\DiagnosticRelatedInformation.cs (1)
22public Location Location { get; set; }
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
35TryAddConverter<Location, VSLocation>();
Protocol\Extensions\VSLocation.cs (1)
10/// <see cref="VSLocation"/> extends <see cref="Location"/> providing additional properties used by Visual Studio.
Protocol\InlayHintLabelPart.cs (1)
59public Location? Location
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
43AddOrReplaceConverter<Location, VSInternalLocation>();
Protocol\Internal\VSInternalLocation.cs (1)
12/// Extension class for <see cref="Protocol.Location"/>. Used to relay reference text information with colorization.
Protocol\Internal\VSInternalMapCodeMapping.cs (1)
39public Location[][]? FocusLocations
Protocol\Internal\VSInternalReferenceItem.cs (1)
34public Location? Location
Protocol\Internal\VSInternalReferenceParams.cs (2)
13internal sealed class VSInternalReferenceParams : ReferenceParams, IPartialResultParams<SumType<VSInternalReferenceItem, Location>[]> 30public new IProgress<SumType<VSInternalReferenceItem, Location>[]>? PartialResultToken { get; set; }
Protocol\Location.cs (3)
17internal class Location : IEquatable<Location> 50return this.Equals(obj as Location); 54public bool Equals(Location? other)
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);
Protocol\Navigation\DeclarationParams.cs (2)
16internal sealed class DeclarationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Navigation\DefinitionParams.cs (2)
16internal sealed class DefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Navigation\ImplementationParams.cs (2)
16internal sealed class ImplementationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Navigation\ReferenceParams.cs (2)
16internal class ReferenceParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<Location[]> 33public IProgress<Location[]>? PartialResultToken { get; set; }
Protocol\Navigation\TypeDefinitionParams.cs (2)
16internal sealed class TypeDefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\SymbolInformation.cs (2)
82public Location Location 122&& EqualityComparer<Location>.Default.Equals(this.Location, other.Location)
Protocol\WorkspaceSymbol.cs (1)
57public SumType<Location, WorkspaceSymbolLocation> Location { get; init; }
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (141)
CodeActions\CodeActionResolveTests.cs (1)
531IList<LSP.Location> locations,
CodeActions\CodeActionsTests.cs (8)
39var caretLocation = testLspServer.GetLocations("caret").Single(); 75var caretLocation = testLspServer.GetLocations("caret").Single(); 114var caret = testLspServer.GetLocations("caret").Single(); 155var caret = testLspServer.GetLocations("caret").Single(); 195var caret = testLspServer.GetLocations("caret").Single(); 238var caret = testLspServer.GetLocations("caret").Single(); 286var caret = testLspServer.GetLocations("caret").Single(); 327internal static CodeActionParams CreateCodeActionParams(LSP.Location caret)
CodeActions\RunCodeActionsTests.cs (1)
38var caretLocation = testLspServer.GetLocations("caret").Single();
CodeLens\AbstractCodeLensTests.cs (3)
36var expectedCodeLens = testLspServer.GetLocations("codeLens").Single(); 57var expectedCodeLens = testLspServer.GetLocations("codeLens").Single(); 80var expectedCodeLens = testLspServer.GetLocations("codeLens").Single();
Completion\CompletionFeaturesTests.cs (10)
81var caret = testLspServer.GetLocations("caret").Single(); 331var caretLocation = testLspServer.GetLocations("caret").Single(); 458var caret = testLspServer.GetLocations("caret").Single(); 652var caret = testLspServer.GetLocations("caret").Single(); 759var caret = testLspServer.GetLocations("caret").Single(); 791var caret = testLspServer.GetLocations("caret").Single(); 847var caretLocation = testLspServer.GetLocations("caret").Single(); 961var caret = testLspServer.GetLocations("caret").Single(); 1030var caret = testLspServer.GetLocations("caret").Single(); 1084var caret = testLspServer.GetLocations("caret").Single();
Completion\CompletionTests.cs (11)
923var caretLocation = testLspServer.GetLocations("caret").Single(); 978var caretLocation = testLspServer.GetLocations("caret").Single(); 1046var caretLocation = testLspServer.GetLocations("caret").Single(); 1114var caretLocation = testLspServer.GetLocations("caret").Single(); 1211var firstCaret = testLspServer.GetLocations("firstCaret").Single(); 1277var caretLocation = testLspServer.GetLocations("caret").Single(); 1338var firstCaretLocation = testLspServer.GetLocations("firstCaret").Single(); 1354var secondCaretLocation = testLspServer.GetLocations("secondCaret").Single(); 1358var triggerLocation = GetLocationPlusOne(secondCaretLocation); 1458var caretLocation = testLspServer.GetLocations("caret").Single(); 1526var caret = testLspServer.GetLocations("caret").Single();
DataTips\DataTipRangeHandlerTests.cs (2)
18private static async Task<LSP.VSInternalDataTip?> RunAsync(TestLspServer testLspServer, LSP.Location caret) 41var caret = testLspServer.GetLocations("caret").Single();
Definitions\GoToDefinitionTests.cs (4)
311var result = Assert.Single(results); 334private static async Task<LSP.Location[]> RunGotoDefinitionAsync(TestLspServer testLspServer, LSP.Location caret) 336return await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentDefinitionName,
Definitions\GoToTypeDefinitionTests.cs (5)
200var result = Assert.Single(results); 228var result = Assert.Single(results); 288private static async Task<LSP.Location[]> RunGotoTypeDefinitionAsync(TestLspServer testLspServer, LSP.Location caret) 290return await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentTypeDefinitionName,
Diagnostics\PullDiagnosticTests.cs (1)
688var textLocation = testLspServer.GetLocations()["insert"].Single();
DocumentChanges\DocumentChangesTests.cs (2)
428private async Task<(TestLspServer, LSP.Location, string)> GetTestLspServerAndLocationAsync(string source, bool mutatingLspWorkspace) 431var locationTyped = testLspServer.GetLocations("type").Single();
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (2)
32var caretLocation = testLspServer.GetLocations("caret").Single(); 77var caretLocation = testLspServer.GetLocations("caret").Single();
Formatting\FormatDocumentOnTypeTests.cs (5)
37var locationTyped = testLspServer.GetLocations("type").Single(); 65var locationTyped = testLspServer.GetLocations("type").Single(); 91var locationTyped = testLspServer.GetLocations("type").Single(); 106LSP.Location locationTyped, 122LSP.Location locationTyped,
Formatting\FormatDocumentRangeTests.cs (4)
37var rangeToFormat = testLspServer.GetLocations("format").Single(); 67var rangeToFormat = testLspServer.GetLocations("format").Single(); 85LSP.Location location, 96LSP.Location location,
Highlights\DocumentHighlightTests.cs (2)
101private static async Task<LSP.DocumentHighlight[]> RunGetDocumentHighlightAsync(TestLspServer testLspServer, LSP.Location caret) 115private static LSP.DocumentHighlight CreateDocumentHighlight(LSP.DocumentHighlightKind kind, LSP.Location location)
Hover\HoverTests.cs (15)
37var expectedLocation = testLspServer.GetLocations("caret").Single(); 61var expectedLocation = testLspServer.GetLocations("caret").Single(); 84var expectedLocation = testLspServer.GetLocations("caret").Single(); 112var expectedLocation = testLspServer.GetLocations("caret").Single(); 184var location = testLspServer.GetLocations("caret").Single(); 238var expectedLocation = testLspServer.GetLocations("caret").Single(); 305var expectedLocation = testLspServer.GetLocations("caret").Single(); 362var expectedLocation = testLspServer.GetLocations("caret").Single(); 403var expectedLocation = testLspServer.GetLocations("caret").Single(); 437var expectedLocation = testLspServer.GetLocations("caret").Single(); 472var expectedLocation = testLspServer.GetLocations("caret").Single(); 501var expectedLocation = testLspServer.GetLocations("caret").Single(); 545var location = testLspServer.GetLocations("caret").Single(); 587var expectedLocation = testLspServer.GetLocations("caret").Single(); 605LSP.Location caret,
InlayHint\AbstractInlayHintTests.cs (1)
44foreach (var location in locations)
InlineCompletions\InlineCompletionsTests.cs (3)
218var locationTyped = testLspServer.GetLocations("tab").Single(); 241var locationTyped = testLspServer.GetLocations("tab").Single(); 258LSP.Location locationTyped,
Metadata\LspMetadataAsSourceWorkspaceTests.cs (6)
42var location = testLspServer.GetLocations("definition").Single(); 43var definition = await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentDefinitionName, 79var location = testLspServer.GetLocations("definition").Single(); 80var definition = await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentDefinitionName, 103var locationOfStringKeyword = new LSP.Location 113var definitionFromMetadata = await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentDefinitionName,
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (3)
76var caret = new LSP.Location { Range = new() { Start = new(0, 6), End = new(0, 7) }, DocumentUri = looseFileUri }; 294var result = await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentDefinitionName, 340private static async Task<LSP.Hover> RunGetHoverAsync(TestLspServer testLspServer, LSP.Location caret)
OnAutoInsert\OnAutoInsertTests.cs (4)
358var locationTyped = testLspServer.GetLocations("type").Single(); 374var locationTyped = testLspServer.GetLocations("type").Single(); 385LSP.Location locationTyped, 395LSP.Location locationTyped,
ProtocolConversionsTests.cs (1)
303var caret = testLspServer.GetLocations("caret").Single();
References\FindAllReferencesHandlerTests.cs (6)
344private static LSP.ReferenceParams CreateReferenceParams(LSP.Location caret, IProgress<object> progress) 353internal static async Task<LSP.VSInternalReferenceItem[]> RunFindAllReferencesAsync(TestLspServer testLspServer, LSP.Location caret, BufferedProgress<object>? progress = null) 370internal static async Task<LSP.Location[]> RunFindAllReferencesNonVSAsync(TestLspServer testLspServer, LSP.Location caret, BufferedProgress<object>? progress = null) 372var results = await testLspServer.ExecuteRequestAsync<LSP.ReferenceParams, LSP.Location[]>(LSP.Methods.TextDocumentReferencesName, 379results = [.. UnwrapProgress<LSP.Location>(progress.Value)];
References\FindImplementationsTests.cs (3)
164private static async Task<LSP.Location[]> RunFindImplementationAsync(TestLspServer testLspServer, LSP.Location caret) 166return await testLspServer.ExecuteRequestAsync<LSP.TextDocumentPositionParams, LSP.Location[]>(LSP.Methods.TextDocumentImplementationName,
Rename\PrepareRenameTests.cs (5)
30var renameLocation = testLspServer.GetLocations("caret").First(); 49var renameLocation = testLspServer.GetLocations("caret").First(); 69var renameLocation = testLspServer.GetLocations("caret").First(); 89var renameLocation = testLspServer.GetLocations("caret").First(); 95private static LSP.PrepareRenameParams CreatePrepareRenameParams(LSP.Location location)
Rename\RenameTests.cs (8)
46var renameLocation = testLspServer.GetLocations("caret").First(); 69var renameLocation = testLspServer.GetLocations("caret").First(); 101var renameLocation = testLspServer.GetLocations("caret").First(); 146var renameLocation = testLspServer.GetLocations("caret").First(); 226var renameLocation = testLspServer.GetLocations("caret").First(); 271var renameLocation = testLspServer.GetLocations("caret").First(); 321var renameLocation = await ProtocolConversions.TextSpanToLocationAsync(generatedDocument, spans["caret"].First(), isStale: false, CancellationToken.None); 333private static LSP.RenameParams CreateRenameParams(LSP.Location location, string newName)
SemanticTokens\AbstractSemanticTokensTests.cs (6)
29private protected static async Task<LSP.SemanticTokens> RunGetSemanticTokensFullAsync(TestLspServer testLspServer, LSP.Location caret) 37private protected static async Task<LSP.SemanticTokens> RunGetSemanticTokensRangeAsync(TestLspServer testLspServer, LSP.Location location) 45private protected static async Task<LSP.SemanticTokens> RunGetSemanticTokensRangesAsync(TestLspServer testLspServer, LSP.Location caret, Range[] ranges) 53private static LSP.SemanticTokensFullParams CreateSemanticTokensFullParams(LSP.Location caret) 59private static LSP.SemanticTokensRangeParams CreateSemanticTokensRangeParams(LSP.Location location) 66private static SemanticTokensRangesParams CreateSemanticTokensRangesParams(LSP.Location caret, Range[] ranges)
SemanticTokens\SemanticTokensRangeTests.cs (2)
629var location = testLspServer.GetLocations("range").Single(); 711var location = testLspServer.GetLocations("range").Single();
SignatureHelp\SignatureHelpTests.cs (1)
106private static async Task<LSP.SignatureHelp?> RunGetSignatureHelpAsync(TestLspServer testLspServer, LSP.Location caret)
SimplifyMethod\SimplifyMethodTests.cs (2)
37var methodInsertionLocation = testLspServer.GetLocations("caret").First(); 55private static SimplifyMethodParams CreateSimplifyMethodParams(LSP.Location location, string newText)
Symbols\DocumentSymbolsTests.cs (2)
250LSP.Location location, LSP.Location selection, LSP.DocumentSymbol? parent = null)
ValidateBreakableRange\ValidateBreakableRangeTests.cs (11)
32var caret = testLspServer.GetLocations("caret").Single(); 57var caret = testLspServer.GetLocations("caret").Single(); 80var caret = testLspServer.GetLocations("caret").Single(); 101var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 124var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 148var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 173var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 202var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 227var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 251var breakpoint = testLspServer.GetLocations("breakpoint").Single(); 259private static async Task<LSP.Range?> RunAsync(TestLspServer testLspServer, LSP.Location caret)
Workspaces\SourceGeneratedDocumentTests.cs (1)
94var location = new LSP.Location { DocumentUri = sourceGeneratorDocumentUri, Range = new LSP.Range { Start = new LSP.Position(0, 6), End = new LSP.Position(0, 6) } };
Microsoft.CodeAnalysis.LanguageServer.UnitTests (12)
Services\ExtractRefactoringTests.cs (3)
29var caretLocation = testLspServer.GetLocations("caret").Single(); 59var caretLocation = testLspServer.GetLocations("caret").Single(); 78LSP.Location caretLocation,
Utilities\AbstractLanguageServerClientTests.cs (5)
95private protected static Dictionary<string, IList<LSP.Location>> GetAnnotatedLocations(DocumentUri codeUri, SourceText text, ImmutableDictionary<string, ImmutableArray<TextSpan>> spanMap) 97var locations = new Dictionary<string, IList<LSP.Location>>(); 110static LSP.Location ConvertTextSpanWithTextToLocation(TextSpan span, SourceText text, DocumentUri documentUri) 112var location = new LSP.Location 139private protected static CodeActionParams CreateCodeActionParams(LSP.Location location)
Utilities\AbstractLanguageServerClientTests.TestLspClient.cs (4)
27private readonly Dictionary<string, IList<LSP.Location>> _locations; 41Dictionary<string, IList<LSP.Location>>? locations = null) 126private TestLspClient(Process process, string pipeName, Dictionary<DocumentUri, SourceText> documents, Dictionary<string, IList<LSP.Location>> locations, ILoggerFactory loggerFactory) 246public IList<LSP.Location> GetLocations(string locationName) => _locations[locationName];
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
DocumentOutline\DocumentOutlineTestsBase.cs (1)
102private EditorTestLspServer(EditorTestWorkspace testWorkspace, Dictionary<string, IList<LanguageServer.Protocol.Location>> locations, InitializationOptions options, AbstractLspLogger logger) : base(testWorkspace, locations, options, logger)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
288public async Task<DocumentSpan?> GetDocumentSpanFromLocationAsync(LSP.Location location, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.Xaml (10)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (10)
32internal sealed class GoToDefinitionHandler : ILspServiceRequestHandler<TextDocumentPositionParams, LSP.Location[]> 51public async Task<LSP.Location[]> HandleRequestAsync(TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken) 53var locations = new ConcurrentBag<LSP.Location>(); 78foreach (var location in await this.GetLocationsAsync(definition, document, solution, cancellationToken).ConfigureAwait(false)) 91private async Task<LSP.Location[]> GetLocationsAsync(XamlDefinition definition, Document document, Solution solution, CancellationToken cancellationToken) 93using var _ = ArrayBuilder<LSP.Location>.GetInstance(out var locations); 111private static async Task<LSP.Location?> GetSourceDefinitionLocationAsync(XamlSourceDefinition sourceDefinition, Solution solution, CancellationToken cancellationToken) 153private static async Task<LSP.Location[]> GetSymbolDefinitionLocationsAsync(XamlSymbolDefinition symbolDefinition, Document document, Solution solution, IMetadataAsSourceFileService metadataAsSourceFileService, IGlobalOptionService globalOptions, CancellationToken cancellationToken) 157using var _ = ArrayBuilder<LSP.Location>.GetInstance(out var locations); 167var location = await ProtocolConversions.TextSpanToLocationAsync(