Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
        public static void PublishHoverMarkdownResponse(this KernelInvocationContext context, RequestHoverText command, string content, LinePositionSpan linePositionSpan)
        {
            var response = new HoverMarkdownProduced(command, content, linePositionSpan);

            context.Publish(response);
        }