Thanks for reaching out,
Visual Studio’s LSP client currently renders hover content as plain text only and does not support Markdown in textDocument/hover. During initialize, the client advertises hover.contentFormat: ["plaintext"]. This is by design today and is tracked as a feature request in Developer Community.
What to do now:
Return a single MarkupContent with Kind = PlainText and pre‑format your message for readability (bullets, ASCII tables). For richer content, provide a Code Action or command to open external documentation.
using Microsoft.VisualStudio.LanguageServer.Protocol;
[JsonRpcMethod(Methods.TextDocumentHoverName)]
public Hover OnHover(JToken arg)
{
var contents = new MarkupContent
{
Kind = MarkupKind.PlainText,
Value =
"MyKeyword\n" +
"Summary: Does something useful.\n\n" +
"Details:\n" +
"- Input: string name\n" +
"- Output: int id\n\n" +
"Notes:\n" +
"Use with care in performance-critical paths."
};
return new Hover { Contents = contents };
References:
- GitHub: Does Visual Studio LSP client support Markdown?
- Developer Community: Support markdown in LSP textDocument/hover responses
- API: Hover class
Let us know if the issue persists after following these steps. I’ll be happy to assist further if needed. If the issue has been resolved, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.