From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Brown Newsgroups: gmane.emacs.bugs Subject: bug#74914: 30.0.90; Eglot: Incorrect parameter highlighted in signatureHelp Date: Mon, 16 Dec 2024 10:19:14 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16530"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Felician Nemeth , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 74914@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 16:20:21 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 1tNCtQ-00045x-UO for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 16:20:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNCtA-0004Ac-CM; Mon, 16 Dec 2024 10:20:04 -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 1tNCt8-00049K-KM for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 10:20: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 1tNCt8-0000HV-3b for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 10:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=t90peEa6qUdvl7OyQlycR2BcqWEp463SRPDYqbUsD28=; b=eZbo/0XXq6Vmy9MT3js5fsWXGF2Gt1ilG7B4vltr/J+YPHJavq3e9bGI1eF55GJSZWiekFeJx/ieWTz/9FCpM903xHxtsjTqI4TnMBZlFrdcYo36vhOHm/5jaA+TEoCMu6KUKZSDnrZGpSIQTyL9ljdrgd9gZftEbd9JcymD6IU2fMrdcNGXq58soMgBalQv1YthheD5S+5LE3e3YHqZbF7iX0ec5HcCSsiIPfQv8rSzLcZZCWewVm2y9lOakHWVc4pN7Gc2Q2pTXQa/KKcq6qe3Ls187mmciyr1sMAG8eD9HLefftaXT/K9r9FYtj+aVTsyzko6P79H95/QJEC/Aw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNCt7-0007TJ-TQ for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 10:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Troy Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 15:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74914 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors" Original-Received: via spool by submit@debbugs.gnu.org id=B.173436237328655 (code B ref -1); Mon, 16 Dec 2024 15:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Dec 2024 15:19:33 +0000 Original-Received: from localhost ([127.0.0.1]:55571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNCse-0007S6-MJ for submit@debbugs.gnu.org; Mon, 16 Dec 2024 10:19:33 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:50002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNCsc-0007Ry-Tz for submit@debbugs.gnu.org; Mon, 16 Dec 2024 10:19:31 -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 1tNCsc-00041X-M0 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 10:19:30 -0500 Original-Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNCsa-0000DB-JD for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 10:19:30 -0500 Original-Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a9e44654ae3so649701866b.1 for ; Mon, 16 Dec 2024 07:19:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734362366; x=1734967166; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t90peEa6qUdvl7OyQlycR2BcqWEp463SRPDYqbUsD28=; b=GuFBoinKbx4hzXHuq2nYtDGvemMi8ueH0tddJXsNvOJHviiXsFfA/VKZ23BgFIKArX tczG4NiEDTsCdO7S1hXhL4/9KIOw7Cv6ryS2wpA+eqx9lXqZC9Gm2UTCssRG8HO1zaNr Ng8xKcYguSWUrQ6edTPo5B12LF4du+B8kWMExEQ0asiUP5Vkz+22WMW/gXQGVGbync6d tE/w3SdSZtzz5o6vYpIcRbKrW9ylC2kHwttaG1lI0F5QlH6BYXZWlP7vQKKFXtEFAs6u /u3ZlQIXOFvoAZX23yxfIDeXrWQu8dD6/iIHctXB2ypNhI1g90lUmwTo6ugeA5yBdwN5 Gxqw== X-Gm-Message-State: AOJu0YwB+2U4NLjUBQH1Qy4TpfmByZ6SxxBCInpNfIagRRfssRf3Rmkz NH8qFnN6PUAq/TccVo/mpQ2UsTQ0C+XznKCXB+62SLFwM7Iethh09tMDK4Ju0Rk= X-Gm-Gg: ASbGncutABKijdnTu35mj+8YEPrproqs5rrqZZ46a2Nw3Z037su8c15WUmf1UkTXVen 3ECMF7YUBC/lOr4AW0S5MREsnNxAEmlv1fCilZ7ySwWBUGOa3Z1HAgdPfromzuf7pWrrHQtrScB qiaScWJEDOWKcvhp7X6K9ExSV+o7QI50m+Imllu2oi1sEkuKjve/XeqrLJHHqhqIvPEUYdZMmYB xYD7jEHzwHw8aGrcGgkY/8Uvaa79TIc3De8vzFbpLLH5J00KEENwbP3MeGsL41sL/CqFZ6Ss1gF 7N0jgMuERuOGmWb/58Ng X-Google-Smtp-Source: AGHT+IFOX5QWWCeCUnRV10USeScbgWLRxwKg6q5Zy5BxPza2oLnkamH3EVXvlhbOXID1+U5r0jTyBA== X-Received: by 2002:a17:906:478a:b0:aa6:a21b:2a9 with SMTP id a640c23a62f3a-aab77ed4d3dmr1260738966b.57.1734362365965; Mon, 16 Dec 2024 07:19:25 -0800 (PST) Original-Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com. [209.85.208.47]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aab96390cbesm340022166b.158.2024.12.16.07.19.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2024 07:19:25 -0800 (PST) Original-Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5d647d5df90so4310596a12.2 for ; Mon, 16 Dec 2024 07:19:25 -0800 (PST) X-Received: by 2002:a17:907:7851:b0:aa6:9b02:7fd0 with SMTP id a640c23a62f3a-aab76d1a271mr1137822366b.0.1734362365173; Mon, 16 Dec 2024 07:19:25 -0800 (PST) X-Gmail-Original-Message-ID: Received-SPF: pass client-ip=209.85.218.48; envelope-from=troy.s.brown@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.13, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:297173 Archived-At: 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":{"t= extDocument":{"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,"characte= r":39}},"source":"libadalang","message":"Missing ';'"},{"range":{"start":{"line":102,"character":38},"end":{"line":102,"char= acter":39}},"source":"libadalang","message":"Skipped token )"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"chara= cter":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 =3D (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).