[Top][All Lists]

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

[elpa] externals/eglot 83b2acb 09/54: Support markdown for textDocument/

From: João Távora
Subject: [elpa] externals/eglot 83b2acb 09/54: Support markdown for textDocument/hover (#329)
Date: Thu, 16 Apr 2020 05:31:46 -0400 (EDT)

branch: externals/eglot
commit 83b2acb30bff33bba67add921639247df1c928da
Author: Xu Chunyang <address@hidden>
Commit: João Távora <address@hidden>

    Support markdown for textDocument/hover (#329)
    * eglot.el (eglot-client-capabilities): annouce markdown support for hover.
    (eglot--format-markup): Format hover info with Markdown.
    Fixes: #328
    Copyright-paperwork-exempt: yes
 eglot.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 285dc50..1f7a396 100644
--- a/eglot.el
+++ b/eglot.el
@@ -489,7 +489,8 @@ treated as in `eglot-dbind'."
                                     :contextSupport t)
-             :hover              `(:dynamicRegistration :json-false)
+             :hover              (list :dynamicRegistration :json-false
+                                       :contentFormat ["markdown" "plaintext"])
              :signatureHelp      (list :dynamicRegistration :json-false
@@ -1080,7 +1081,9 @@ Doubles as an indicator of snippet support."
                (if (stringp markup) (list (string-trim markup)
                                           (intern "gfm-view-mode"))
                  (list (plist-get markup :value)
-                       major-mode))))
+                       (pcase (plist-get markup :kind)
+                         ("markdown" 'gfm-view-mode)
+                         (_ major-mode))))))
       (insert string)
       (ignore-errors (delay-mode-hooks (funcall mode)))

reply via email to

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