GNU bug report logs -
#74914
30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
Previous Next
Reported by: Troy Brown <brownts <at> troybrown.dev>
Date: Mon, 16 Dec 2024 15:20:01 UTC
Severity: normal
Tags: patch
Found in version 30.0.90
Done: João Távora <joaotavora <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 6 Jan 2025 10:55:26 +0000
with message-id <CALDnm51FbT8YfOjmZgNxyiqpptWrOYNH27h1gqx0rNA=q2uRbA <at> mail.gmail.com>
and subject line Re: bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
has caused the debbugs.gnu.org bug report #74914,
regarding 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
74914: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74914
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
I'm working with a language server that provides an `activeParameter`
field both in SignatureHelp (set to 0) as well as in
SignatureInformation (set to 1). Under this condition, for the
signature output in the echo area, Eglot always displays the first
parameter (i.e., index 0). According to the LSP specification, when
an `activeParameter` field is specified in SignatureInformation "this
is used in place of `SignatureHelp.activeParameter`". The following
is a partial log covering this transaction:
[jsonrpc] e[09:50:52.423] --> textDocument/signatureHelp[97]
{"jsonrpc":"2.0","id":97,"method":"textDocument/signatureHelp","params":{"textDocument":{"uri":"file:///home/troy/junk/gtkada_24.0.0_80c56171/src/glib.adb"},"position":{"line":102,"character":38}}}
[jsonrpc] e[09:50:52.444] <-- textDocument/publishDiagnostics
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/troy/junk/gtkada_24.0.0_80c56171/src/glib.adb","diagnostics":[{"range":{"start":{"line":102,"character":38},"end":{"line":102,"character":39}},"source":"libadalang","message":"Missing
';'"},{"range":{"start":{"line":102,"character":38},"end":{"line":102,"character":39}},"source":"libadalang","message":"Skipped
token )"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"severity":4,"source":"ada.project","message":""}]}}
[jsonrpc] e[09:50:52.445] <-- textDocument/hover[95]
{"jsonrpc":"2.0","id":95,"result":null}
[jsonrpc] e[09:50:52.454] <-- textDocument/documentHighlight[96]
{"jsonrpc":"2.0","id":96,"result":null}
[jsonrpc] e[09:50:52.454] <-- textDocument/signatureHelp[97]
{"jsonrpc":"2.0","id":97,"result":{"signatures":[{"label":"function
Internal (Name : String; Thing : String) return
GType","documentation":"","parameters":[{"label":"Name"},{"label":"Thing"}],"activeParameter":1}],"activeSignature":0,"activeParameter":0}}
I believe the reason for Eglot's behavior is due to the way
"active-param" is specified in the cl-loop within `eglot--sig-info`.
```text
with active-param = (or sig-active activeParameter)
```
The value of activeParameter in SignatureInformation (activeParameter)
should be given higher priority (i.e., listed first) over the
activeParameter specified in SignatureHelp (sig-active).
[Message part 3 (message/rfc822, inline)]
I pushed this patch yesterday. Thanks everyone, closing the bug.
On Sun, Jan 5, 2025 at 2:20 AM Troy Brown <brownts <at> troybrown.dev> wrote:
>
> On Sat, Dec 28, 2024 at 10:22 PM Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> >
> > So, does this fix the problem for you?
> >
> > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> > index 816a1e67eca..51c19d5681a 100644
> > --- a/lisp/progmodes/eglot.el
> > +++ b/lisp/progmodes/eglot.el
> > @@ -3416,7 +3416,7 @@ eglot--sig-info
> > 'font-lock-function-name-face))))
> > ;; Now to the parameters
> > (cl-loop
> > - with active-param = (or sig-active activeParameter)
> > + with active-param = (or activeParameter sig-active)
> > for i from 0 for parameter across parameters do
> > (eglot--dbind ((ParameterInformation)
> > ((:label parlabel))
> >
>
> I'm not sure how the diff was created, as I couldn't get it to apply
> cleanly, but yes, this change does fix the issue.
--
João Távora
This bug report was last modified 132 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.