GNU bug report logs -
#61373
Eglot patch: add customization to prefer plaintext for :hover
Previous Next
Reported by: JD Smith <jdtsmith <at> gmail.com>
Date: Wed, 8 Feb 2023 21:34:01 UTC
Severity: normal
Done: João Távora <joaotavora <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#61373: Eglot patch: add customization to prefer plaintext for :hover
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 61373 <at> debbugs.gnu.org.
--
61373: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61373
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
JD Smith <jdtsmith <at> gmail.com> writes:
> Some LSP servers badly mangle their responses to :hover into markdown that gfm-viewmode cannot render. See this
> discussion, for example.
>
> The attached patch adds a new custom option `eglot-prefer-plaintext’ which configures the server to use plaintext for :
> hover responses, even if Emacs could in principle handle markdown. Unfortunately, the popular Python LSP server in
> question (pyright) is not interested in improvement to its generated markdown (since it "works in VS-Code”). Luckily the
> plaintext docstrings of most packages are very nicely formatted.
Hi,
I've pushed your patch to master:
commit 4566a0c6b825a18e6c065da0543b8b942b7db8df (HEAD -> master, origin/master, origin/HEAD)
Author: JD Smith <jdtsmith <at> gmail.com>
Date: Thu Mar 23 17:43:52 2023 +0000
Eglot: let user opt-in to plaintext LSP docs (bug#61373)
* lisp/progmodes/eglot.el
(eglot-prefer-plaintext): New variable.
(eglot-client-capabilities): Use it.
Copyright-paperwork-exempt: yes
I opted noted not to describe eglot-prefer-plaintext in the manual,
because I think this option should ultimately live in ElDoc, not in
Eglot. Properly supporting markdown rendering in Eldoc is hard though,
so there's little reason not to push this simple workaround.
Closing this bug. See also bug#61072 and bug#62029 for more discussion.
João
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Some LSP servers badly mangle their responses to :hover into markdown that gfm-viewmode cannot render. See this discussion <https://github.com/joaotavora/eglot/discussions/1039>, for example.
The attached patch adds a new custom option `eglot-prefer-plaintext’ which configures the server to use plaintext for :hover responses, even if Emacs could in principle handle markdown. Unfortunately, the popular Python LSP server in question (pyright) is not interested in improvement to its generated markdown (since it "works in VS-Code”). Luckily the plaintext docstrings of most packages are very nicely formatted.
[Message part 5 (text/html, inline)]
[eglot_plaintext.patch (application/octet-stream, attachment)]
[Message part 7 (text/html, inline)]
This bug report was last modified 2 years and 118 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.