unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74807: 30.0.90; Eglot: Non-Markdown strings rendered as Markdown
@ 2024-12-12  0:46 Troy Brown
  2024-12-12  8:30 ` João Távora
  0 siblings, 1 reply; 2+ messages in thread
From: Troy Brown @ 2024-12-12  0:46 UTC (permalink / raw)
  To: 74807; +Cc: Felician Nemeth, João Távora

I've run across a situation where Eglot receives a documentation
string as part of a "completionItem/resolve".  The documentation is
being provided as a regular "string", not MarkupContent, yet it is
being rendered as markup.  Since the string contains characters which
are being interpreted as markdown (e.g., ":"), it causes the
documentation to be rendered incorrectly.

[jsonrpc] e[19:22:22.458]     <-- completionItem/resolve[21]
{"jsonrpc":"2.0","id":21,"result":{"label":"End_Of_Line","documentation":"End
of line sequence: lf | crlf","data":["Format","End_Of_Line"]}}

I believe this is because `eglot-completion-at-point` calls
`eglot--format-markup` for the documentation string provided in the
CompletionItem without first checking to see if it really should be
formatted (i.e., if it is a string it shouldn't be formatted).  While
`eglot--format-markup` will handle strings, it should only be passed
strings which are intended to be markup formated (specified as
MarkedString in the specification).

I believe this issue might affect more than just the documentation
string for CompletionItem, it's possible this also affects other
places which specify fields as "string | MarkupContent" (such as the
SignatureInformation documentation field).





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#74807: 30.0.90; Eglot: Non-Markdown strings rendered as Markdown
  2024-12-12  0:46 bug#74807: 30.0.90; Eglot: Non-Markdown strings rendered as Markdown Troy Brown
@ 2024-12-12  8:30 ` João Távora
  0 siblings, 0 replies; 2+ messages in thread
From: João Távora @ 2024-12-12  8:30 UTC (permalink / raw)
  To: Troy Brown; +Cc: 74807, felician.nemeth

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

Please provide more of the eglot events log.

Thanks,
João

On Thu, Dec 12, 2024, 00:46 Troy Brown <brownts@troybrown.dev> wrote:

> I've run across a situation where Eglot receives a documentation
> string as part of a "completionItem/resolve".  The documentation is
> being provided as a regular "string", not MarkupContent, yet it is
> being rendered as markup.  Since the string contains characters which
> are being interpreted as markdown (e.g., ":"), it causes the
> documentation to be rendered incorrectly.
>
> [jsonrpc] e[19:22:22.458]     <-- completionItem/resolve[21]
>
> {"jsonrpc":"2.0","id":21,"result":{"label":"End_Of_Line","documentation":"End
> of line sequence: lf | crlf","data":["Format","End_Of_Line"]}}
>
> I believe this is because `eglot-completion-at-point` calls
> `eglot--format-markup` for the documentation string provided in the
> CompletionItem without first checking to see if it really should be
> formatted (i.e., if it is a string it shouldn't be formatted).  While
> `eglot--format-markup` will handle strings, it should only be passed
> strings which are intended to be markup formated (specified as
> MarkedString in the specification).
>
> I believe this issue might affect more than just the documentation
> string for CompletionItem, it's possible this also affects other
> places which specify fields as "string | MarkupContent" (such as the
> SignatureInformation documentation field).
>

[-- Attachment #2: Type: text/html, Size: 2027 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-12  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12  0:46 bug#74807: 30.0.90; Eglot: Non-Markdown strings rendered as Markdown Troy Brown
2024-12-12  8:30 ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).