]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: let user opt-in to plaintext LSP docs (bug#61373)
authorJD Smith <jdtsmith@gmail.com>
Thu, 23 Mar 2023 17:43:52 +0000 (17:43 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 23 Mar 2023 21:14:21 +0000 (21:14 +0000)
* lisp/progmodes/eglot.el
(eglot-prefer-plaintext): New variable.
(eglot-client-capabilities): Use it.

Copyright-paperwork-exempt: yes

lisp/progmodes/eglot.el

index fae1c8db8b7f878699cc4e5062a830e756710e18..806e498c38cbcc022aa121ec721fda4f34e84ee5 100644 (file)
@@ -391,6 +391,10 @@ done by `eglot-reconnect'."
   "If non-nil, activate Eglot in cross-referenced non-project files."
   :type 'boolean)
 
+(defcustom eglot-prefer-plaintext nil
+  "If non-nil, always request plaintext responses to hover requests."
+  :type 'boolean)
+
 (defcustom eglot-menu-string "eglot"
   "String displayed in mode line when Eglot is active."
   :type 'string)
@@ -776,7 +780,8 @@ treated as in `eglot--dbind'."
                                     :contextSupport t)
              :hover              (list :dynamicRegistration :json-false
                                        :contentFormat
-                                       (if (fboundp 'gfm-view-mode)
+                                       (if (and (not eglot-prefer-plaintext)
+                                                (fboundp 'gfm-view-mode))
                                            ["markdown" "plaintext"]
                                          ["plaintext"]))
              :signatureHelp      (list :dynamicRegistration :json-false