GNU bug report logs - #64274
30.0.50; Eglot requests textDocument/documentSymbol if its not declared in the server capabilities

Previous Next

Package: emacs;

Reported by: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>

Date: Sat, 24 Jun 2023 19:48:02 UTC

Severity: normal

Found in version 30.0.50

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #28 received at 64274-done <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>, 64274-done <at> debbugs.gnu.org
Subject: Re: bug#64274: 30.0.50; Eglot requests textDocument/documentSymbol if
 its not declared in the server capabilities
Date: Sat, 1 Jul 2023 23:07:46 +0100
Pushed this patch to master and marking this done.

João

On Sun, Jun 25, 2023 at 12:22 AM Wilhelm Kirschbaum
<wkirschbaum <at> gmail.com> wrote:
>
>
>
> > 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



-- 
João Távora




This bug report was last modified 2 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.