: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 ()
(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)))
"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