summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2023-04-27 21:08:17 +0100
committerJoão Távora <joaotavora@gmail.com>2023-04-28 00:39:08 +0100
commit44ebd9cbd56b820ad5b014b442b5a9142e8cac89 (patch)
tree4f4968af8b646b543b079760c12a67394a1c3125 /lisp/progmodes
parent941ef044f2e0607bcaa537fbb56790a512c38782 (diff)
downloademacs-44ebd9cbd56b820ad5b014b442b5a9142e8cac89.tar.gz
Eglot: explain how to update Eglot in manual (bug#62720)
* lisp/progmodes/eglot.el (eglot-update): New command. * doc/misc/eglot.texi (Troubleshooting): Rework.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/eglot.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 0fab8db0e83..f005c4858e7 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1966,6 +1966,16 @@ If it is activated, also signal textDocument/didOpen."
(declare (obsolete info "29.1"))
(interactive) (info "(eglot)"))
+;;;###autoload
+(defun eglot-update (&rest _) "Update Eglot."
+ (interactive)
+ (with-no-warnings
+ (require 'package)
+ (unless package-archive-contents (package-refresh-contents))
+ (when-let ((existing (cadr (assoc 'eglot package-alist))))
+ (package-delete existing t))
+ (package-install (cadr (assoc 'eglot package-archive-contents)))))
+
(easy-menu-define eglot-menu nil "Eglot"
`("Eglot"
;; Commands for getting information and customization.
@@ -3056,8 +3066,7 @@ for which LSP on-type-formatting should be requested."
(funcall snippet-fn (or insertText label))))
(when (cl-plusp (length additionalTextEdits))
(eglot--apply-text-edits additionalTextEdits)))
- (eglot--signal-textDocument/didChange)
- (eldoc)))))))))
+ (eglot--signal-textDocument/didChange)))))))))
(defun eglot--hover-info (contents &optional _range)
(mapconcat #'eglot--format-markup