[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/eglot2emacs 9dbc18cbfa 084/120: Tweak some details, fix some bug
From: |
João Távora |
Subject: |
feature/eglot2emacs 9dbc18cbfa 084/120: Tweak some details, fix some bugs |
Date: |
Thu, 20 Oct 2022 07:17:00 -0400 (EDT) |
branch: feature/eglot2emacs
commit 9dbc18cbfa5c838453a2036c8d37c673bbc8de1f
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Tweak some details, fix some bugs
eglot--recover-workspace-symbol-meta had a bug that still made it
choke on improper lists.
Also, when simply M-. to the thing at point, let's not lose time on
iterating a potentially out-of-date eglot--workspace-symbols-cache.
So clear it early in the pre-command-hook.
* eglot.el (eglot--workspace-symbols-cache): Move up.
(eglot--pre-command-hook): Clear eglot--workspace-symbols-cache here.
(eglot--recover-workspace-symbol-meta): Check for consp.
GitHub-reference: per https://github.com/joaotavora/eglot/issues/131
---
lisp/progmodes/eglot.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 6d3667a84a..6f9c4f50f2 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2101,8 +2101,12 @@ THINGS are either registrations or unregisterations
(sic)."
:key #'seq-first))))
(eglot-format (point) nil last-input-event))))
+(defvar eglot--workspace-symbols-cache (make-hash-table :test #'equal)
+ "Cache of `workspace/Symbol' results used by `xref-find-definitions'.")
+
(defun eglot--pre-command-hook ()
"Reset some temporary variables."
+ (clrhash eglot--workspace-symbols-cache)
(setq eglot--last-inserted-char nil))
(defun eglot--CompletionParams ()
@@ -2392,9 +2396,6 @@ Try to visit the target file for a richer summary line."
(eglot--current-server-or-lose))
(xref-make-match summary (xref-make-file-location file line column)
length)))
-(defvar eglot--workspace-symbols-cache (make-hash-table :test #'equal)
- "Cache of `workspace/Symbol' results used by `xref-find-definitions'.")
-
(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql eglot)))
(if (eglot--server-capable :workspaceSymbolProvider)
(let ((buf (current-buffer)))
@@ -2446,10 +2447,10 @@ Try to visit the target file for a richer summary line."
"Search `eglot--workspace-symbols-cache' for rich entry of STRING."
(catch 'found
(maphash (lambda (_k v)
- (while v
+ (while (consp v)
;; Like mess? Ask minibuffer.el about improper lists.
(when (equal (car v) string) (throw 'found (car v)))
- (setq v (and (consp v) (cdr v)))))
+ (setq v (cdr v))))
eglot--workspace-symbols-cache)))
(add-to-list 'completion-category-overrides
- feature/eglot2emacs 4071eaf8ad 116/120: * eglot.el (version): actually bump to 1.9, (continued)
- feature/eglot2emacs 4071eaf8ad 116/120: * eglot.el (version): actually bump to 1.9, João Távora, 2022/10/20
- feature/eglot2emacs 9801e217f9 118/120: Rework header of eglot.el, João Távora, 2022/10/20
- feature/eglot2emacs 77f3157dcd 048/120: Use new jdtls script for eclipse jdt, João Távora, 2022/10/20
- feature/eglot2emacs 349f6b5f78 050/120: Don't advertise didchangewatchedfiles on tramp, João Távora, 2022/10/20
- feature/eglot2emacs 965e1378f1 053/120: Use bounds of thing at point when asking for code actions, João Távora, 2022/10/20
- feature/eglot2emacs a38ce8b28f 052/120: Add simple support for workspacefolders, João Távora, 2022/10/20
- feature/eglot2emacs cb562118cb 047/120: Don't strip invisible text when formatting hover string, João Távora, 2022/10/20
- feature/eglot2emacs 904556f662 058/120: Easier initializationoptions in eglot-server-programs, João Távora, 2022/10/20
- feature/eglot2emacs 49e56e47d8 066/120: Solve flymake diagnostics synchronization problems, João Távora, 2022/10/20
- feature/eglot2emacs 917e8ffa31 080/120: Add support for jedi-language-server, João Távora, 2022/10/20
- feature/eglot2emacs 9dbc18cbfa 084/120: Tweak some details, fix some bugs,
João Távora <=
- feature/eglot2emacs 2a12f622dc 087/120: Eglot-workspace-configuration can be a function, João Távora, 2022/10/20
- feature/eglot2emacs 1986c4df88 089/120: Reply more reasonably to server's workspace/applyedit, João Távora, 2022/10/20
- feature/eglot2emacs bef332a983 101/120: Adjust last commit about workspace configuration, João Távora, 2022/10/20
- feature/eglot2emacs 523547321e 102/120: Allow :initializationoptions in eglot-server-programs, João Távora, 2022/10/20
- feature/eglot2emacs 68b9c03b44 106/120: Don't use three-argument plist-get, João Távora, 2022/10/20
- feature/eglot2emacs 0829d5e7a2 107/120: Revert "fix jdtls support", João Távora, 2022/10/20
- feature/eglot2emacs b205479035 108/120: Fix blunder in eglot--guess-contact, João Távora, 2022/10/20
- feature/eglot2emacs b07fa37d04 113/120: Add half-baked m-x eglot-list-connections, João Távora, 2022/10/20
- feature/eglot2emacs 4f1f06375a 045/120: Prevent empty diagnostic tags vector hiding main fontification, João Távora, 2022/10/20
- feature/eglot2emacs be47552331 049/120: Change capability 'documentchanges' to t, João Távora, 2022/10/20