emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/eglot 24877ae 15/15: Fix a bug introduced in the previo


From: João Távora
Subject: [elpa] externals/eglot 24877ae 15/15: Fix a bug introduced in the previous commit
Date: Sun, 20 May 2018 19:59:04 -0400 (EDT)

branch: externals/eglot
commit 24877aeff3853a493deda0b722f7d12e1ab745d7
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Fix a bug introduced in the previous commit
    
    * eglot.el (eglot--format-markup): Ignore errors when calling
    possibly unknown functions.
    (eglot-completion-at-point): Use eglot--format-markup
    (eglot--hover-info): Yak shaving
---
 eglot.el | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/eglot.el b/eglot.el
index 72e5d31..9d7253a 100644
--- a/eglot.el
+++ b/eglot.el
@@ -779,7 +779,8 @@ If optional MARKER, return a marker instead"
                  (list (plist-get markup :value)
                        (intern (concat (plist-get markup :language) "-mode" 
))))))
     (with-temp-buffer
-      (funcall mode) (insert string) (font-lock-ensure) (buffer-string))))
+      (ignore-errors (funcall mode))
+      (insert string) (font-lock-ensure) (buffer-string))))
 
 (defun eglot--server-capable (&rest feats)
 "Determine if current server is capable of FEATS."
@@ -1324,10 +1325,7 @@ DUMMY is ignored"
                                     :documentation)))))
            (when documentation
              (with-current-buffer (get-buffer-create " *eglot doc*")
-               (erase-buffer)
-               (ignore-errors (funcall (intern "markdown-mode")))
-               (font-lock-ensure)
-               (insert documentation)
+               (insert (eglot--format-markup documentation))
                (current-buffer)))))
        :exit-function (lambda (_string _status)
                         (eglot--signal-textDocument/didChange)
@@ -1339,10 +1337,8 @@ DUMMY is ignored"
   (concat (and range (pcase-let ((`(,beg ,end) (eglot--range-region range)))
                        (concat (buffer-substring beg end)  ": ")))
           (mapconcat #'eglot--format-markup
-                     (append (cond ((vectorp contents)
-                                    contents)
-                                   (contents
-                                    (list contents)))) "\n")))
+                     (append (cond ((vectorp contents) contents)
+                                   (contents (list contents)))) "\n")))
 
 (defun eglot--sig-info (sigs active-sig active-param)
   (cl-loop



reply via email to

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