emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d69d0b1a296 03/10: Eglot: declare support for markdown also for s


From: João Távora
Subject: master d69d0b1a296 03/10: Eglot: declare support for markdown also for signatures
Date: Sun, 2 Apr 2023 19:15:39 -0400 (EDT)

branch: master
commit d69d0b1a296c17508663afc9d0301b8ccaa7115e
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: declare support for markdown also for signatures
    
    * lisp/progmodes/eglot.el
    (eglot--accepted-formats): new helper.
    (eglot-client-capabilities): use it.
---
 lisp/progmodes/eglot.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]