bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64274: 30.0.50; Eglot requests textDocument/documentSymbol if its no


From: Wilhelm Kirschbaum
Subject: bug#64274: 30.0.50; Eglot requests textDocument/documentSymbol if its not declared in the server capabilities
Date: Sun, 25 Jun 2023 01:21:16 +0200
User-agent: mu4e 1.9.3; emacs 30.0.50



OK, this makes sense.  Then please test this instead.

João

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index e2478f2dde3..c353ab6fce0 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3348,9 +3348,11 @@ eglot--imenu-DocumentSymbol
(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

Yes, this works. Thank you. :)

Wilhelm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]