Skip to content

Commit

Permalink
Support markdown for textDocument/hover (#329)
Browse files Browse the repository at this point in the history
* eglot.el (eglot-client-capabilities): annouce markdown support for hover.
(eglot--format-markup): Format hover info with Markdown.

Fixes: #328

Copyright-paperwork-exempt: yes
(#329: joaotavora/eglot#329
#328: joaotavora/eglot#328
  • Loading branch information
xuchunyang authored and joaotavora committed Oct 28, 2019
1 parent dd77133 commit 0951926
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ treated as in `eglot-dbind'."
t
:json-false))
:contextSupport t)
:hover `(:dynamicRegistration :json-false)
:hover (list :dynamicRegistration :json-false
:contentFormat ["markdown" "plaintext"])
:signatureHelp (list :dynamicRegistration :json-false
:signatureInformation
`(:parameterInformation
Expand Down Expand Up @@ -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))))))
(with-temp-buffer
(insert string)
(ignore-errors (delay-mode-hooks (funcall mode)))
Expand Down

0 comments on commit 0951926

Please sign in to comment.