105 references to ProtocolConversions
Microsoft.CodeAnalysis.LanguageServer.Protocol (105)
Extensions\Extensions.cs (5)
31: ProtocolConversions.CreateAbsoluteUri(document.FilePath); 47return ProtocolConversions.CreateAbsoluteUri(path); 58return ProtocolConversions.CreateAbsoluteUri(path); 80return solution.GetDocumentIdsWithFilePath(ProtocolConversions.GetDocumentFilePathFromUri(documentUri)); 131var projectId = ProtocolConversions.ProjectContextToProjectId(vsDocumentIdentifier.ProjectContext);
Extensions\ProtocolConversions.Diagnostics.cs (2)
85Uri = ProtocolConversions.CreateAbsoluteUri(l.UnmappedFileSpan.Path) 108CodeDescription = ProtocolConversions.HelpLinkToCodeDescription(diagnosticData.GetValidHelpLinkUri()),
Extensions\SourceGeneratedDocumentUri.cs (1)
49return ProtocolConversions.CreateAbsoluteUri(uri);
ExternalAccess\Razor\FormatNewFileHandler.cs (1)
49var filePath = ProtocolConversions.GetDocumentFilePathFromUri(request.Document.Uri);
ExternalAccess\Razor\SimplifyMethodHandler.cs (2)
55var pendingChange = ProtocolConversions.TextEditToTextChange(textEdit, originalSourceText); 72return changes.Select(change => ProtocolConversions.TextChangeToTextEdit(change, originalSourceText)).ToArray();
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (3)
40var span = ProtocolConversions.RangeToTextSpan(request.Range, text); 83var breakpointRange = ProtocolConversions.TextSpanToRange(breakpointSpan, text); 106breakpointRange = ProtocolConversions.TextSpanToRange(breakpointSpan, text);
Handler\CodeActions\CodeActionFixAllResolveHandler.cs (1)
70var resolveData = JsonSerializer.Deserialize<CodeActionResolveData>((JsonElement)request.Data!, ProtocolConversions.LspJsonSerializerOptions);
Handler\CodeActions\CodeActionHelpers.cs (3)
65applicableRange: set.ApplicableToSpan.HasValue ? ProtocolConversions.TextSpanToRange(set.ApplicableToSpan.Value, documentText) : null, 266? ProtocolConversions.TextSpanToRange(nestedActionSet.ApplicableToSpan.Value, documentText) : null, 390var textSpan = ProtocolConversions.RangeToTextSpan(selection, text);
Handler\CodeActions\CodeActionResolveHandler.cs (1)
101var resolveData = JsonSerializer.Deserialize<CodeActionResolveData>((JsonElement)request.Data!, ProtocolConversions.LspJsonSerializerOptions);
Handler\CodeActions\CodeActionResolveHelper.cs (1)
289var edits = textChanges.Select(tc => new LSP.SumType<LSP.TextEdit, LSP.AnnotatedTextEdit>(ProtocolConversions.TextChangeToTextEdit(tc, oldText))).ToArray();
Handler\CodeLens\CodeLensHandler.cs (3)
96var range = ProtocolConversions.TextSpanToRange(member.Span, text); 143var range = ProtocolConversions.TextSpanToRange(member.Span, text); 173var range = ProtocolConversions.TextSpanToRange(member.Span, text);
Handler\CodeLens\CodeLensResolveHandler.cs (1)
90var resolveData = JsonSerializer.Deserialize<CodeLensResolveData>((JsonElement)codeLens.Data, ProtocolConversions.LspJsonSerializerOptions);
Handler\Completion\CompletionHandler.cs (3)
55.GetPositionFromLinePositionAsync(ProtocolConversions.PositionToLinePosition(request.Position), cancellationToken) 84var completionTrigger = await ProtocolConversions 125var completionTrigger = await ProtocolConversions.LSPToRoslynCompletionTriggerAsync(context, document, position, cancellationToken).ConfigureAwait(false);
Handler\Completion\CompletionResolveHandler.cs (1)
107ProtocolConversions.DocumentToTextDocumentIdentifier(document),
Handler\Completion\CompletionResultFactory.cs (8)
64var resolveData = new CompletionResolveData(resultId, ProtocolConversions.DocumentToTextDocumentIdentifier(document)); 88EditRange = capabilityHelper.SupportDefaultEditRange ? ProtocolConversions.TextSpanToRange(defaultSpan, documentText) : null, 177if (ProtocolConversions.RoslynTagToCompletionItemKinds.TryGetValue(tag, out var completionItemKinds)) 205if (ProtocolConversions.RoslynTagToCompletionItemTags.TryGetValue(tag, out var completionItemTags)) 493Range = ProtocolConversions.TextSpanToRange(completionChangeSpan, documentText), 539Range = ProtocolConversions.TextSpanToRange(change.Span, sourceText), 591lspItem.Documentation = ProtocolConversions.GetDocumentationMarkupContent( 684Range = ProtocolConversions.TextSpanToRange(completionChangeSpan, documentText),
Handler\Completion\Extensions.cs (1)
55var resolveData = JsonSerializer.Deserialize<CompletionResolveData>((JsonElement)request.Data, ProtocolConversions.LspJsonSerializerOptions);
Handler\Definitions\AbstractGoToDefinitionHandler.cs (4)
45var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 67var location = await ProtocolConversions.TextSpanToLocationAsync( 89Uri = ProtocolConversions.CreateAbsoluteUri(declarationFile.FilePath), 90Range = ProtocolConversions.LinePositionToRange(linePosSpan),
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
316return ProtocolConversions.ConvertDiagnostic(
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (1)
28? new VSTextDocumentIdentifier { ProjectContext = ProtocolConversions.ProjectToProjectContext(Document.Project), Uri = Document.GetURI() }
Handler\Diagnostics\DiagnosticSources\AbstractProjectDiagnosticSource.cs (2)
32? new VSTextDocumentIdentifier { ProjectContext = ProtocolConversions.ProjectToProjectContext(Project), Uri = ProtocolConversions.CreateAbsoluteUri(Project.FilePath) }
Handler\DocumentChanges\DidChangeHandler.cs (2)
70var newChanges = contentChanges.Reverse().SelectAsArray(change => ProtocolConversions.ContentChangeEventToTextChange(change, text)); 77text = text.WithChanges(ProtocolConversions.ContentChangeEventToTextChange(change, text));
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (3)
36var rangeSpan = (range != null) ? ProtocolConversions.RangeToTextSpan(range, text) : new TextSpan(0, root.FullSpan.Length); 40var formattingOptions = await ProtocolConversions.GetFormattingOptionsAsync(options, document, cancellationToken).ConfigureAwait(false); 46edits.AddRange(textChanges.Select(change => ProtocolConversions.TextChangeToTextEdit(change, text)));
Handler\Formatting\FormatDocumentOnTypeHandler.cs (3)
47var position = await document.GetPositionFromLinePositionAsync(ProtocolConversions.PositionToLinePosition(request.Position), cancellationToken).ConfigureAwait(false); 63var formattingOptions = await ProtocolConversions.GetFormattingOptionsAsync(request.Options, document, cancellationToken).ConfigureAwait(false); 76edits.AddRange(textChanges.Select(change => ProtocolConversions.TextChangeToTextEdit(change, documentSyntax.Text)));
Handler\Highlights\DocumentHighlightHandler.cs (4)
49var position = ProtocolConversions.PositionToLinePosition(request.Position); 86Range = ProtocolConversions.TextSpanToRange(highlight, text) 108Range = ProtocolConversions.TextSpanToRange(h.TextSpan, text), 109Kind = ProtocolConversions.HighlightSpanKindToDocumentHighlightKind(h.Kind),
Handler\Hover\HoverHandler.cs (4)
47var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 123Range = ProtocolConversions.TextSpanToRange(info.Span, text), 145Range = ProtocolConversions.TextSpanToRange(info.Span, text), 146Contents = ProtocolConversions.GetDocumentationMarkupContent(tags, language, supportsMarkdown),
Handler\InlayHint\InlayHintHandler.cs (3)
75var textEdit = ProtocolConversions.TextChangeToTextEdit(hint.ReplacementTextChange.Value, text); 81Position = ProtocolConversions.LinePositionToPosition(linePosition), 100var textSpan = ProtocolConversions.RangeToTextSpan(range, text);
Handler\InlayHint\InlayHintResolveHandler.cs (2)
72request.ToolTip = ProtocolConversions.GetDocumentationMarkupContent(taggedText, document, true); 85var resolveData = JsonSerializer.Deserialize<InlayHintResolveData>((JsonElement)inlayHint.Data, ProtocolConversions.LspJsonSerializerOptions);
Handler\InlineCompletions\InlineCompletionsHandler.cs (3)
117var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 140var formattingOptions = await ProtocolConversions.GetFormattingOptionsAsync(request.Options, document, cancellationToken).ConfigureAwait(false); 151Range = ProtocolConversions.TextSpanToRange(wordOnLeft.Value, sourceText),
Handler\MapCode\MapCodeHandler.cs (3)
76Changes = uriToEditsMap.ToDictionary(kvp => ProtocolConversions.GetDocumentFilePathFromUri(kvp.Key), kvp => kvp.Value) 110var textEdits = textChanges.Value.Select(change => ProtocolConversions.TextChangeToTextEdit(change, oldText)).ToArray(); 134builder.Add((document, ProtocolConversions.RangeToTextSpan(location.Range, focusText)));
Handler\OnAutoInsert\OnAutoInsertHandler.cs (4)
55var position = ProtocolConversions.PositionToLinePosition(request.Position); 72var formattingOptions = await ProtocolConversions.GetFormattingOptionsAsync(lspFormattingOptions, document, cancellationToken).ConfigureAwait(false); 137Range = ProtocolConversions.TextSpanToRange(result.SpanToReplace, sourceText) 201Range = ProtocolConversions.TextSpanToRange(textChange.Span, sourceText)
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (1)
52var projectContext = ProtocolConversions.ProjectToProjectContext(project);
Handler\References\FindAllReferencesHandler.cs (1)
62ProtocolConversions.PositionToLinePosition(referenceParams.Position), cancellationToken).ConfigureAwait(false);
Handler\References\FindImplementationsHandler.cs (3)
41var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 64locations.AddIfNotNull(await ProtocolConversions.DocumentSpanToLocationWithTextAsync(sourceSpan, text, cancellationToken).ConfigureAwait(false)); 68locations.AddIfNotNull(await ProtocolConversions.DocumentSpanToLocationAsync(sourceSpan, cancellationToken).ConfigureAwait(false));
Handler\References\FindUsagesLSPContext.cs (4)
221Kind = symbolUsageInfo.HasValue ? ProtocolConversions.SymbolUsageInfoToReferenceKinds(symbolUsageInfo.Value) : [], 253return await ProtocolConversions.DocumentSpanToLocationAsync(documentSpan.Value, cancellationToken).ConfigureAwait(false); 281Uri = ProtocolConversions.CreateAbsoluteUri(declarationFile.FilePath), 282Range = ProtocolConversions.LinePositionToRange(linePosSpan),
Handler\Rename\PrepareRenameHandler.cs (2)
29=> GetRenameRangeAsync(context.GetRequiredDocument(), ProtocolConversions.PositionToLinePosition(request.Position), cancellationToken); 41return ProtocolConversions.TextSpanToRange(symbolicRenameInfo.TriggerToken.Span, text);
Handler\Rename\RenameHandler.cs (2)
32=> GetRenameEditAsync(context.GetRequiredDocument(), ProtocolConversions.PositionToLinePosition(request.Position), request.NewName, cancellationToken); 81var documentEdits = await ProtocolConversions.ChangedDocumentsToTextDocumentEditsAsync(changedDocuments, renamedSolution.GetRequiredDocument, oldSolution.GetRequiredDocument,
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
46spans.Add(ProtocolConversions.RangeToLinePositionSpan(range));
Handler\ServerLifetime\InitializeHandler.cs (1)
44m["capabilities"] = JsonSerializer.Serialize(serverCapabilities, ProtocolConversions.LspJsonSerializerOptions);
Handler\SignatureHelp\SignatureHelpHandler.cs (1)
40var linePosition = ProtocolConversions.PositionToLinePosition(request.Position);
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (2)
161var textDocumentIdentifier = ProtocolConversions.DocumentToTextDocumentIdentifier(document); 190var kind = ProtocolConversions.SpellCheckSpanKindToSpellCheckableRangeKind(span.Kind);
Handler\Symbols\DocumentSymbolsHandler.cs (5)
95var kind = ProtocolConversions.GlyphToSymbolKind(item.Glyph); 99Range = ProtocolConversions.TextSpanToRange(symbolItem.Location.InDocumentInfo.Value.navigationSpan, text), 125Kind = ProtocolConversions.GlyphToSymbolKind(item.Glyph), 130Range = ProtocolConversions.TextSpanToRange(spans.First(), text), 131SelectionRange = ProtocolConversions.TextSpanToRange(navigationSpan, text),
Handler\Symbols\WorkspaceSymbolsHandler.cs (2)
89var location = await ProtocolConversions.TextSpanToLocationAsync( 97ProtocolConversions.NavigateToKindToSymbolKind(result.Kind),
RoslynLanguageServer.cs (2)
199uri = JsonSerializer.Deserialize<Uri>(uriToken, ProtocolConversions.LspJsonSerializerOptions); 209var data = JsonSerializer.Deserialize<DocumentResolveData>(dataToken, ProtocolConversions.LspJsonSerializerOptions);
Workspaces\LspMiscellaneousFilesWorkspace.cs (2)
41var documentFilePath = ProtocolConversions.GetDocumentFilePathFromUri(uri); 78var documentFilePath = ProtocolConversions.GetDocumentFilePathFromUri(uri);