]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: declare support for markdown also for signatures
authorJoão Távora <joaotavora@gmail.com>
Fri, 24 Mar 2023 22:17:44 +0000 (22:17 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 2 Apr 2023 22:40:46 +0000 (23:40 +0100)
* lisp/progmodes/eglot.el
(eglot--accepted-formats): new helper.
(eglot-client-capabilities): use it.

lisp/progmodes/eglot.el

index 3458fbc7cb2c75fd2cebeca261e11eeeb93db8a9..8e47c397ca87ac3ac19be522168d24258a6abfc5 100644 (file)
@@ -452,6 +452,10 @@ This can be useful when using docker to run a language server.")
   (if (>= emacs-major-version 27) (executable-find command remote)
     (executable-find command)))
 
+(defun eglot--accepted-formats ()
+  (if (and (not eglot-prefer-plaintext) (fboundp 'gfm-view-mode))
+      ["markdown" "plaintext"] ["plaintext"]))
+
 \f
 ;;; Message verification helpers
 ;;;
@@ -782,15 +786,12 @@ treated as in `eglot--dbind'."
                                       :tagSupport (:valueSet [1]))
                                     :contextSupport t)
              :hover              (list :dynamicRegistration :json-false
-                                       :contentFormat
-                                       (if (and (not eglot-prefer-plaintext)
-                                                (fboundp 'gfm-view-mode))
-                                           ["markdown" "plaintext"]
-                                         ["plaintext"]))
+                                       :contentFormat (eglot--accepted-formats))
              :signatureHelp      (list :dynamicRegistration :json-false
                                        :signatureInformation
                                        `(:parameterInformation
                                          (:labelOffsetSupport t)
+                                         :documentationFormat ,(eglot--accepted-formats)
                                          :activeParameterSupport t))
              :references         `(:dynamicRegistration :json-false)
              :definition         (list :dynamicRegistration :json-false