mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 16:51:06 -07:00
Eglot: guard against empty 'textDocument/documentSymbol' response
* lisp/progmodes/eglot.el (eglot-imenu): Protect against missing response.
This commit is contained in:
parent
3c8167ec0f
commit
2d24eb69ed
1 changed files with 5 additions and 4 deletions
|
|
@ -3295,10 +3295,11 @@ Returns a list as described in docstring of `imenu--index-alist'."
|
|||
`(:textDocument
|
||||
,(eglot--TextDocumentIdentifier))
|
||||
:cancel-on-input non-essential))
|
||||
(head (and res (elt res 0))))
|
||||
(eglot--dcase head
|
||||
(((SymbolInformation)) (eglot--imenu-SymbolInformation res))
|
||||
(((DocumentSymbol)) (eglot--imenu-DocumentSymbol res)))))
|
||||
(head (and (cl-plusp (length res)) (elt res 0))))
|
||||
(when head
|
||||
(eglot--dcase head
|
||||
(((SymbolInformation)) (eglot--imenu-SymbolInformation res))
|
||||
(((DocumentSymbol)) (eglot--imenu-DocumentSymbol res))))))
|
||||
|
||||
(cl-defun eglot--apply-text-edits (edits &optional version)
|
||||
"Apply EDITS for current buffer if at VERSION, or if it's nil."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue