https://bugs.kde.org/show_bug.cgi?id=494139

--- Comment #6 from Alex Lowe <len...@gmail.com> ---
(In reply to Waqar Ahmed from comment #1)
> I wonder if its the server's fault or our fault. If the server escapes
> markdown characters by putting backslashes, thats how they will appear...

I was initially working to create a report on the YAML language server, but I
noticed that kate was also behaving this way with the vscode JSON language
server. VSCode doesn't show this same behaviour though, either in JSON or in
YAML.

I asked some coworkers to compare with their text editors and got the
following:

- Emacs appears to behave mostly-correctly, but ignores the backslashes that
are undoing the "markdownification" of bullet points and then treats those
hyphens as bullet points
- PyCharm eats the newlines, but doesn't include the slashes (Incorrect because
a double-newline in Markdown should be treated as a newline in the resulting
formatted document)
- VSCode behaves what appears to be "most correctly" from a user perspective,
as the contents field is correctly turned into a string (converting "\n" in the
raw JSON to a newline character and unescaping "\\" to a single "\"), and then
that string is treated as Markdown (including unescaping characters - see:
https://www.markdownguide.org/basic-syntax/#characters-you-can-escape)

Looking further, the current protocol specification shows the "contents" field
to be one of three types
(https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover).
In this case, it's a plain string, which is one of the two forms of the
MarkedString type
(https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#markedString).
While this is a deprecated type, the relevance here is that the MarkedString is
a union type either of a plain string which needs to be rendered in (presumably
GitHub dialect) Markdown or an object that provides both the language and the
value.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to