Subject: Re: bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp

From: Dmitry Gutov <[email-masked]>
Date: Sun, 29 Dec 2024 05:22:48 +0200

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))