Eglot: bail out of eglot-imenu if no server capability (bug#64274)
* lisp/progmodes/eglot.el (eglot-imenu): Bail out if no capability.
This commit is contained in:
parent
03d4ca6f6b
commit
f6e6d6c730
1 changed files with 3 additions and 1 deletions
|
@ -3350,9 +3350,11 @@ for which LSP on-type-formatting should be requested."
|
|||
(mapcar (lambda (c) (apply #'dfs c)) children))))))
|
||||
(mapcar (lambda (s) (apply #'dfs s)) res)))
|
||||
|
||||
(defun eglot-imenu ()
|
||||
(cl-defun eglot-imenu ()
|
||||
"Eglot's `imenu-create-index-function'.
|
||||
Returns a list as described in docstring of `imenu--index-alist'."
|
||||
(unless (eglot--server-capable :textDocument/documentSymbol)
|
||||
(cl-return-from eglot-imenu))
|
||||
(let* ((res (eglot--request (eglot--current-server-or-lose)
|
||||
:textDocument/documentSymbol
|
||||
`(:textDocument
|
||||
|
|
Loading…
Add table
Reference in a new issue