]> git.eshelyaron.com Git - emacs.git/commitdiff
Add eglot-clear-status interactive command
authorJoão Távora <joaotavora@gmail.com>
Wed, 2 May 2018 12:31:26 +0000 (13:31 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 2 May 2018 14:50:17 +0000 (15:50 +0100)
* eglot.el (eglot-clear-status): New
(eglot-forget-pending-continuations): Fix bug.
(eglot--mode-line-format): Add link to eglot-clear-status.

lisp/progmodes/eglot.el

index 1a82cc507d3b2ebec9380bc370f5396b0894398d..db594f4984a8e6e2ed0e160c05eb3a9f03920c69 100644 (file)
@@ -361,9 +361,14 @@ identifier.  ERROR is non-nil if this is an error."
 
 (defun eglot-forget-pending-continuations (process)
   "Stop waiting for responses from the current LSP PROCESS."
-  (interactive (eglot--current-process-or-lose))
+  (interactive (list (eglot--current-process-or-lose)))
   (clrhash (eglot--pending-continuations process)))
 
+(defun eglot-clear-status (process)
+  "Clear most recent error message from PROCESS."
+  (interactive (list (eglot--current-process-or-lose)))
+  (setf (eglot--status process) nil))
+
 (cl-defun eglot--request (process
                           method
                           params
@@ -668,12 +673,15 @@ running.  INTERACTIVE is t if called interactively."
              `("/"
                (:propertize
                 ,status
-                help-echo ,(concat "mouse-1: go to events buffer")
+                help-echo ,(concat "mouse-1: go to events buffer\n"
+                                   "mouse-3: clear this status")
                 mouse-face mode-line-highlight
                 face compilation-mode-line-fail
                 keymap ,(let ((map (make-sparse-keymap)))
                           (define-key map [mode-line mouse-1]
                             'eglot-events-buffer)
+                          (define-key map [mode-line mouse-3]
+                            'eglot-clear-status)
                           map))))
          ,@(when (and doing (not done-p))
              `("/"