From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#61506: 30.0.50; [PATCH]: Send command in eglot completion exit-function Date: Tue, 14 Feb 2023 23:49:35 +0000 Message-ID: <87v8k3st80.fsf@gmail.com> References: <87h6vo1ph6.fsf@thornhill.no> <87pmacjl4l.fsf@betli.tmit.bme.hu> <74E0BF9F-42AF-4578-9681-D0FB936081AE@thornhill.no> 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="34397"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Felician Nemeth , 61506@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 00:48:19 2023 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 1pS522-0008kR-U9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 00:48:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS51r-0004TZ-7h; Tue, 14 Feb 2023 18:48:07 -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 1pS51n-0004T9-2G for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 18:48:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pS51l-0006R0-VC for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 18:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pS51l-0006mp-Pk for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 18:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2023 23:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61506 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61506-submit@debbugs.gnu.org id=B61506.167641847426034 (code B ref 61506); Tue, 14 Feb 2023 23:48:01 +0000 Original-Received: (at 61506) by debbugs.gnu.org; 14 Feb 2023 23:47:54 +0000 Original-Received: from localhost ([127.0.0.1]:57365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS51d-0006ln-V6 for submit@debbugs.gnu.org; Tue, 14 Feb 2023 18:47:54 -0500 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:46858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS51c-0006kx-GB for 61506@debbugs.gnu.org; Tue, 14 Feb 2023 18:47:52 -0500 Original-Received: by mail-wr1-f52.google.com with SMTP id m14so17403838wrg.13 for <61506@debbugs.gnu.org>; Tue, 14 Feb 2023 15:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nKfAMX0S7TNY8BnctNG2Xw0ye6FsNE8bkB/10TnEFPg=; b=RcWKLiS9fBD/eDAcJmdNHp0ccMGGr8SosF/Zcci+WnQ+SHFL+nXIU4ZTXc/Bn1uYgh Uhk8wUIJAvJErkk4v3K2FGuD3FHBqx8pLIKv2JVhF7FiU7qLofCRDac6FTj8ntimKZMT qgnAFEywZsmpLD8ajinaMUWrRt1hmnqFPt1y0nBbyGqnzsw+E9+FqMm5hZIjxn2bHtti ErK0xKxP0QVzVLh3E3wsgtnnr6E73nTWM9ZpFKNyRx24Jto9Dm3JR8byaEn7p69ABIUm bSeh92tkF8H58Qtuh+4D5NoTUMfRid/nWgqLs2eQhpA4nolR0LsrP1KILqiPU8oMPQg0 T8rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nKfAMX0S7TNY8BnctNG2Xw0ye6FsNE8bkB/10TnEFPg=; b=48sOowsp+k2GL+rObp2M5e2PrNhfrhQSmavWndJrXSKRI/2363bweFkaN5bcxdzeaN tfbacPUV8+p4fUcAmh4/J/s7xKE2nHk4NC2cnLrpoS7LWcRXDIXd4CrUnmF9IMHivLZX W/257StQqF4TUITrenaBfGrZ7x7paZgI1UR0I+CCeYhL/JmU4VxzAUNHoIm9TDwnFMsc m/NS05KHOJnl3Cqa5w5fyE4+Xjqf8KwCwK12DAD8FOmN/F7BAMJecpjHFqYQHxi7Pr+6 796sXNWKTQVbFejossNUW9gtZweVszbojoLkhmZaztb+Um++QkVvyDbgTwQv5KANWu1y 5cBg== X-Gm-Message-State: AO0yUKXTUCJypPDYEsE00ZcgeNPOYF5gR4b/f5yzaKewj47DxJeEss7O C3k45YIrwtFWr6ZMsCPdEQ3sUjdgvII= X-Google-Smtp-Source: AK7set9mXIUXv3/LX/A3xqUKJXULNmGHce7VUVahSizhI5RWl4EplzeFJNOZCOSU7wJchFNvz69yVQ== X-Received: by 2002:adf:ea47:0:b0:2c5:510b:8f9c with SMTP id j7-20020adfea47000000b002c5510b8f9cmr3593526wrn.52.1676418466339; Tue, 14 Feb 2023 15:47:46 -0800 (PST) Original-Received: from krug (87-196-72-142.net.novis.pt. [87.196.72.142]) by smtp.gmail.com with ESMTPSA id d15-20020a5d6dcf000000b002c3f9404c45sm14530046wrz.7.2023.02.14.15.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 15:47:45 -0800 (PST) In-Reply-To: <74E0BF9F-42AF-4578-9681-D0FB936081AE@thornhill.no> (Theodor Thornhill's message of "Tue, 14 Feb 2023 18:44:01 +0100") 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:255648 Archived-At: Theodor Thornhill writes: >>Can you list some servers that send this info? And if it is not too >>much trouble can write a simple recipe where supporting this feature >>actually makes a difference? Thanks. > > As for proving a difference, not sure how easy that is. The code > around the link I posted seems to score, so I guess over time the > server should learn _something_. It's a little hard to verify anyway > because eglot doesn't respect the ordering provided by the server > (which is a different bug in itself). I don't understand what you mean. There is this code in eglot-completion-at-point: =20 ... (sort-completions (lambda (completions) (cl-sort completions #'string-lessp :key (lambda (c) (or (plist-get (get-text-property 0 'eglot--lsp-item c) :sortText) ""))))) ... Is it not working? I see sensible orderings in the servers I use. Is there a reported bug about this? If there isn't, please make one. > Anyway, lsp-mode, neovim and others support this, so I see no reason > we shouldn't :) FWIW I don't see this as a good enough reason in itself. If there is little to no discernible benefit, supporting esoteric features can become code bloat that makes maintenance of more important features difficult. There is a fair amount of junk in the LSP standard, or simply stuff that doesn't make as much sense in Emacs as it does in other editors. Regardless, I'm not opposed to this feature if there's a simple enough patch. But we should weigh pros and cons -- and Felici=C3=A1n's request to measure the pros is quite reasonable. (Not to mention that a smart enough server can already derive these smarts from the evolution of the LSP document's contents as reported by the client.) Jo=C3=A3o