Currently, diagnostic messages do not carry any formatting information, this forces clients to be conservative when displaying them, see https://github.com/Microsoft/vscode/issues/22239 and the proposed solution:
Going forward. Deprecate the current way diagnostics are rendered and make them work just like the regular hover: a Markdown string which defaults to a non-monospace font but still lets language feature providers open up monospace code blocks with triple back quotes.
We could the same that we did for CompletionItems and make this a client capability.
This is still something that would vastly improve the experience.
Most helpful comment
This is still something that would vastly improve the experience.