108 references to ProtocolConversions
Microsoft.CodeAnalysis.LanguageServer.Protocol (108)
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)
36var span = ProtocolConversions.RangeToTextSpan(request.Range, text); 79var breakpointRange = ProtocolConversions.TextSpanToRange(breakpointSpan, text); 102breakpointRange = 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\DataTips\DataTipRangeHandler.cs (3)
36var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 45HoverRange = ProtocolConversions.TextSpanToRange(info.Span, text), 46ExpressionRange = ProtocolConversions.TextSpanToRange(info.ExpressionSpan, text),
Handler\Definitions\AbstractGoToDefinitionHandler.cs (4)
45var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 67var location = await ProtocolConversions.TextSpanToLocationAsync( 91Uri = ProtocolConversions.CreateAbsoluteUri(declarationFile.FilePath), 92Range = 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)
107var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 153var formattingOptions = await ProtocolConversions.GetFormattingOptionsAsync(options, document, cancellationToken).ConfigureAwait(false); 160Range = 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)
59var position = ProtocolConversions.PositionToLinePosition(request.Position); 76var formattingOptions = await ProtocolConversions.GetFormattingOptionsAsync(lspFormattingOptions, document, cancellationToken).ConfigureAwait(false); 139Range = ProtocolConversions.TextSpanToRange(result.SpanToReplace, sourceText) 203Range = ProtocolConversions.TextSpanToRange(textChange.Span, sourceText)
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (1)
52var projectContext = ProtocolConversions.ProjectToProjectContext(project);
Handler\References\FindAllReferencesHandler.cs (1)
59var linePosition = ProtocolConversions.PositionToLinePosition(referenceParams.Position);
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)
222Kind = symbolUsageInfo.HasValue ? ProtocolConversions.SymbolUsageInfoToReferenceKinds(symbolUsageInfo.Value) : [], 250return await ProtocolConversions.DocumentSpanToLocationAsync(documentSpan.Value, cancellationToken).ConfigureAwait(false); 278Uri = ProtocolConversions.CreateAbsoluteUri(declarationFile.FilePath), 279Range = 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);