* bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
@ 2024-12-16 15:19 Troy Brown
[not found] ` <handler.74914.B.173436237328655.ack@debbugs.gnu.org>
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Troy Brown @ 2024-12-16 15:19 UTC (permalink / raw)
To: 74914; +Cc: Felician Nemeth, João Távora
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).
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74914: Acknowledgement (30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp)
[not found] ` <handler.74914.B.173436237328655.ack@debbugs.gnu.org>
@ 2024-12-23 15:54 ` Troy Brown
0 siblings, 0 replies; 5+ messages in thread
From: Troy Brown @ 2024-12-23 15:54 UTC (permalink / raw)
To: 74914; +Cc: Felician Nemeth, João Távora
FYI, this appears to be a regression introduced by
e33c0a549153fa3894f3b5e9c5e42ce07a1a68c7
Troy.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
2024-12-16 15:19 bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Troy Brown
[not found] ` <handler.74914.B.173436237328655.ack@debbugs.gnu.org>
@ 2024-12-28 11:33 ` Eli Zaretskii
2024-12-28 13:28 ` João Távora
2024-12-29 3:22 ` Dmitry Gutov
2 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-12-28 11:33 UTC (permalink / raw)
To: Troy Brown, joaotavora; +Cc: felician.nemeth, 74914
> Cc: Felician Nemeth <felician.nemeth@gmail.com>,
> João Távora <joaotavora@gmail.com>
> From: Troy Brown <brownts@troybrown.dev>
> Date: Mon, 16 Dec 2024 10:19:14 -0500
>
> 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).
João, any comments or suggestions?
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
2024-12-28 11:33 ` bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Eli Zaretskii
@ 2024-12-28 13:28 ` João Távora
0 siblings, 0 replies; 5+ messages in thread
From: João Távora @ 2024-12-28 13:28 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Troy Brown, Felician Nemeth, 74914
[-- Attachment #1: Type: text/plain, Size: 2904 bytes --]
This looks like it's good, but i'd have to double check in 2025 (away from
my machine until then) unless Felician is confident and signs off on it.
João
On Sat, Dec 28, 2024, 11:33 Eli Zaretskii <eliz@gnu.org> wrote:
> > Cc: Felician Nemeth <felician.nemeth@gmail.com>,
> > João Távora <joaotavora@gmail.com>
> > From: Troy Brown <brownts@troybrown.dev>
> > Date: Mon, 16 Dec 2024 10:19:14 -0500
> >
> > 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).
>
> João, any comments or suggestions?
>
[-- Attachment #2: Type: text/html, Size: 4565 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp
2024-12-16 15:19 bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Troy Brown
[not found] ` <handler.74914.B.173436237328655.ack@debbugs.gnu.org>
2024-12-28 11:33 ` bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Eli Zaretskii
@ 2024-12-29 3:22 ` Dmitry Gutov
2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2024-12-29 3:22 UTC (permalink / raw)
To: Troy Brown, 74914; +Cc: Felician Nemeth, João Távora
Hi!
On 16/12/2024 17:19, Troy Brown wrote:
> 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).
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))
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-12-29 3:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16 15:19 bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Troy Brown
[not found] ` <handler.74914.B.173436237328655.ack@debbugs.gnu.org>
2024-12-23 15:54 ` bug#74914: Acknowledgement (30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp) Troy Brown
2024-12-28 11:33 ` bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Eli Zaretskii
2024-12-28 13:28 ` João Távora
2024-12-29 3:22 ` Dmitry Gutov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.