public static HoverResponse FromHoverEvent(HoverTextProduced responseEvent) { var markupContent = responseEvent switch { HoverMarkdownProduced markdown => new MarkupContent(MarkupKind.Markdown, markdown.Content), HoverPlainTextProduced plainText => new MarkupContent(MarkupKind.Plaintext, plainText.Content), _ => throw new NotSupportedException(), }; return(new HoverResponse( markupContent, Range.FromLinePositionSpan(responseEvent.Range))); }
public static void PublishHoverPlainTextResponse(this KernelInvocationContext context, RequestHoverText command, string content, LinePositionSpan linePositionSpan) { var response = new HoverPlainTextProduced(command, content, linePositionSpan); context.Publish(response); }