From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Date: Sat, 28 Dec 2024 13:33:51 +0200 Message-ID: <868qs0t528.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25205"; mail-complaints-to="usenet@ciao.gmane.io" Cc: felician.nemeth@gmail.com, 74914@debbugs.gnu.org To: Troy Brown , joaotavora@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 12:35:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tRV64-0006RG-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 12:35:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRV61-0003Rx-2T; Sat, 28 Dec 2024 06:35:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRV5y-0003Qu-Oq for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 06:35:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRV5y-0008Dg-G6 for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 06:35:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=tFty5J7wOWcpCZk4a9IQ6+/dJx8a68hx2O6+E5ycYTw=; b=BP1awI/wmKcuIPx+DVwp9vCns5SjitWhGWPvv6NSYl+1OqWPNrTqN7skGlsx+eXSnA9jjnK0tvcqufu6boL7SRw95etJOTDf2zOzq1itZ4peB0K4mCTJu1iehMb1fgY4am0QGUm+2Ihlw+Mhj+J0/zytRWJVcX5gMDz5yZ6/V057gR62wPpgB7mVKheNC39YEGhpDsseFzSeRJ4paG6U9TPK1fX42hrmN+TEN2rknKKSsUbZCHf3w1t3k8GYYkdpIeW7rFqaWgviKTgA0OXW67XWIymcihvPs8FOp3dc7fpJXz8lQUVu1f52qPm4TkwrWgsHLPnRR94brCu20alpcA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRV5y-0008Dm-Ab for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 06:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 11:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74914 X-GNU-PR-Package: emacs Original-Received: via spool by 74914-submit@debbugs.gnu.org id=B74914.173538564431509 (code B ref 74914); Sat, 28 Dec 2024 11:35:02 +0000 Original-Received: (at 74914) by debbugs.gnu.org; 28 Dec 2024 11:34:04 +0000 Original-Received: from localhost ([127.0.0.1]:49481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRV51-0008C1-KW for submit@debbugs.gnu.org; Sat, 28 Dec 2024 06:34:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRV4z-0008BB-8Q for 74914@debbugs.gnu.org; Sat, 28 Dec 2024 06:34:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRV4t-00087i-Fl; Sat, 28 Dec 2024 06:33:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=tFty5J7wOWcpCZk4a9IQ6+/dJx8a68hx2O6+E5ycYTw=; b=PdZEX0UTpDGgahf8oYUW +vUrjkfDMGdIM7EjtGk5DIdxCMyCizB51fsqyzmTcNTlTTqHMtbqLc0JB5M/u98Bg3HsDr2OmtJkc iFWQXCPpLKCYqWwMcncfapE2TgeqNSNEexw8jM3H0NzjtqQi6USg38X9s04j1skEmcIyzwhNr5C9d yLt95IudhqLkQs0ajEmhQBCJE/DWZErwHKt3kxN7MzAqCu1rskRNf1RXj9JEl4pwUSO3i3ElkAXIi kkb9cwQSGRr8R1Cv9iMG2e+63dB8CWWXNDdIXG2MrJ/1a8oTLsDTsF7jRj4snOnsxiC7nRCtRZsVp W/grJLCYGHUEIQ==; In-Reply-To: (message from Troy Brown on Mon, 16 Dec 2024 10:19:14 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297884 Archived-At: > Cc: Felician Nemeth , > João Távora > From: Troy Brown > 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?