MarkDown Hover text from a custom Langauge Server (LSP)

Sajith 86 Reputation points
2026-09-09T14:56:13.9533333+00:00

I develop an extension in Visual Studio that implements a Language Server (LSP) and support Hover (textDocument/hover) on keywords in editor. I was using MarkupKind.Markdown for the Hover Contents type.

					hover = new Hover
					{
						Contents = new MarkupContent
						{
							Kind = MarkupKind.Markdown,
							Value = hoverText
						}
					};

This was working fine earlier in both VS2022 and VS2026. But doesn't work with VS2026 update - 18.9.1.

Setting Kind to 'MarkupKind.PlainText' works fine. Is this expected with VS2026 - 18.9.1 ?

Is only PlainText supported, doesn't Visual Studio support Markdown text as Hover from a custom Language Server textDocument/hover request?
I want to show rich text hover as in C#
User's image

Is this possible from a custom Language Server(LSP)? Please guide how to implement this.

Developer technologies | Visual Studio | Extensions
0 comments No comments

1 answer

Sort by: Most helpful
  1. Jay Pham (WICLOUD CORPORATION) 4,680 Reputation points Microsoft External Staff Moderator
    2026-09-10T01:21:33.3366667+00:00

    Hi @Sajith ,

    The Hover construction you shared is a valid way to supply MarkupContent; Microsoft’s API documentation explicitly lists it as an accepted type for Hover.Contents. However, this alone does not establish Markdown rendering support in a particular Visual Studio client. learn.microsoft.com

    Since you reported that the same implementation worked before updating to 18.9.1, I would investigate a possible client-side change rather than immediately classify this as expected behavior. This is not yet a confirmed regression. learn.microsoft.com

    Please compare capabilities.textDocument.hover.contentFormat in the client’s initialize request between the working and affected versions. This capability identifies the supported markup formats. learn.microsoft.com

    For troubleshooting, please:

    • Test a minimal value such as "**Hover test**\n\nSimple description.".
    • Capture the actual serialized hover response.
    • If the client advertises only plaintext, use plain-text content as a compatibility fallback.
    • If it advertises Markdown but the minimal response fails only in the affected version, submit a Report a Problem with the reproduction and LSP traces. learn.microsoft.com

    For a tooltip with custom icons, classified text, and interactive links like the screenshot, consider a Visual Studio-side Async Quick Info provider. Microsoft provides an official sample; this is an editor-extension approach rather than a server-only Markdown change.

    Note: This is not an official Microsoft Learn document, however it contains useful information that you may refer to. github.com

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. 

    Thank you. 

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.