From: João Távora Date: Fri, 24 Mar 2023 22:17:44 +0000 (+0000) Subject: Eglot: declare support for markdown also for signatures X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d69d0b1a296c17508663afc9d0301b8ccaa7115e;p=emacs.git Eglot: declare support for markdown also for signatures * lisp/progmodes/eglot.el (eglot--accepted-formats): new helper. (eglot-client-capabilities): use it. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 3458fbc7cb2..8e47c397ca8 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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"])) + ;;; 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