From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61506: 30.0.50; [PATCH]: Send command in eglot completion exit-function Date: Wed, 15 Feb 2023 13:34:32 +0100 Message-ID: <875yc3qf8n.fsf@thornhill.no> References: <87h6vo1ph6.fsf@thornhill.no> <87pmacjl4l.fsf@betli.tmit.bme.hu> <74E0BF9F-42AF-4578-9681-D0FB936081AE@thornhill.no> <87v8k3st80.fsf@gmail.com> Reply-To: Theodor Thornhill 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="35915"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Felician Nemeth , 61506@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 13:35:18 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 1pSH0H-00092W-Kg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 13:35:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSH05-00079d-OS; Wed, 15 Feb 2023 07: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 1pSH03-00079L-Gd for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 07:35: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 1pSH03-0001jV-3g for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 07:35:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSH02-00055V-GO for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 07:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 12:35:02 +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.167646447919515 (code B ref 61506); Wed, 15 Feb 2023 12:35:02 +0000 Original-Received: (at 61506) by debbugs.gnu.org; 15 Feb 2023 12:34:39 +0000 Original-Received: from localhost ([127.0.0.1]:58123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSGzf-00054h-6G for submit@debbugs.gnu.org; Wed, 15 Feb 2023 07:34:39 -0500 Original-Received: from out-61.mta1.migadu.com ([95.215.58.61]:16124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSGza-00054U-79 for 61506@debbugs.gnu.org; Wed, 15 Feb 2023 07:34:37 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1676464473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FhjjjKdASPy/LFGEimfPeydr+Pttivzy5SW8LqS4bW4=; b=WzegHW7RS26zwgPB7dUe/5XhO8cG1Bv0rHxKWZeMjXFJOGdXgZwKovWfHxBHLMq7bDtcti AZBthm/8jr+b/NvazSUgEMiSL/arMAUqRUP+vnm3iqtKcWRTPp8w0s6afAox0Di8TGHIn3 TocnAAYr8uAb9JAbfYYWavwF7lHq1DnEPvRvxSOTAD2QYW75HTH6SApJ+iRJf2gUPQLkNi x5PhZaEAYIE0WqSORrnqr+DZemos3e/Lz0VCr79UZfzT06TnZdBao3w98vG9+YyFsoNhS3 x495Oa/xBN+E/eqAbiDgjNxQSkeBehwz15tK8U4CTc5JvIUQNPViIOxz4UGR+g== In-Reply-To: <87v8k3st80.fsf@gmail.com> X-Migadu-Flow: FLOW_OUT 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:255686 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > 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=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. > It seems something happens with yasnippets. I only have the symptoms yet, but I'll make a report when I know what's happening :) >> 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. > Yeah, I agree. However, this should make sense in Emacs too, no? > 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. The patch is simple enough, it could just be its own function, to be executed. Then it's a one-liner in the exit-function > > (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.) > Maybe - I don't think that's reason enough to dismiss the command argument outright, though. > Jo=C3=A3o Theo