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: Mon, 20 Feb 2023 15:13:36 +0100 Message-ID: <874jrga0hb.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> <875yc3qf8n.fsf@thornhill.no> <87357262gf.fsf@thornhill.no> 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="19056"; 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 Mon Feb 20 15:14: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 1pU6vq-0004l3-7f for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 15:14:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU6ve-0000EN-9l; Mon, 20 Feb 2023 09:14:06 -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 1pU6vb-0000C9-9B for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:14: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 1pU6vb-0002xP-0H for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pU6va-00042k-C6 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:14: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: Mon, 20 Feb 2023 14:14: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.167690242115496 (code B ref 61506); Mon, 20 Feb 2023 14:14:02 +0000 Original-Received: (at 61506) by debbugs.gnu.org; 20 Feb 2023 14:13:41 +0000 Original-Received: from localhost ([127.0.0.1]:51088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU6vF-00041r-5l for submit@debbugs.gnu.org; Mon, 20 Feb 2023 09:13:41 -0500 Original-Received: from out-62.mta1.migadu.com ([95.215.58.62]:16034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU6vC-00041c-N2 for 61506@debbugs.gnu.org; Mon, 20 Feb 2023 09:13:39 -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=1676902417; 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=/Vr2UZ20yB2Syg3TZge54ex4tlh0iAfR93ZS2mGbiqo=; b=ZIJoouyUVE/Csr21oiUxcklyEBTmSLAzeqpgd4xxX0kCdFKv94F+U1hdlr7QdkMmkCCVHW t/ylsknctKN8lqgBArilGUdlvcNNLmiqh/lTa2r7s4IDsnsZ9WJct0hG+P3je03m9+RXIf 6Gilt2mRM6h+yhVV6bQu+uranR2JQfCcInU3HB1z+BnxmDZtPK9wJFu4as02iXd/OsN65Q ZKeg3dLtha/pGn9IxHVp5YjlJaSjMYKPC3a4qpoMyNjrLV7nFe4Nu8qgTzZk7oDRXa3Mx4 wP76wU70zWPyOyvWq+rEs9AcaplvqP34CnQhzQX90JRFIdB4wt+6KMi6wQ4ffg== In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 18 Feb 2023 23:23:41 +0000") 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:256178 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Sat, Feb 18, 2023 at 10:20 PM Theodor Thornhill wr= ote: > > Ping :-) > > Presuming you meant to ping me, I'm not sure I can provide much more input > at the moment. As I wrote, if someone is familiar with this part of the = standard=20 > I'll be happy to review a patch adding this to Eglot.=20=20 > > I share with Felician a concern: if the notification can be sent from the= exit-function=20 > it's one thing, and the patch is possibly a one or two-liner. If, OTOH, = the notification=20 > has to be sent after the didChange that follows a completion choice, then= it's=20 > probably a much more complicated change. > Yeah, the patch add this only to the exit-function, which also sends a didChange. No need to add this to anything else than the exit-function, I believe. Not sure whether you looked at the patch, but here it is inlined: ``` Send command in eglot completion exit-function * lisp/progmodes/eglot.el: Destructure optional argument command. (eglot-completion-at-point): Send command if supplied by server. 1 file changed, 4 insertions(+), 1 deletion(-) lisp/progmodes/eglot.el | 5 ++++- modified lisp/progmodes/eglot.el @@ -2925,7 +2925,7 @@ eglot-completion-at-point (window-buffer (minibuffer-selected-wi= ndow)) (current-buffer)) (eglot--dbind ((CompletionItem) insertTextFormat - insertText textEdit additionalTextEdits label) + insertText textEdit additionalTextEdits label = command) (funcall resolve-maybe (or (get-text-property 0 'eglot--lsp-item proxy) @@ -2965,6 +2965,9 @@ eglot-completion-at-point (when (cl-plusp (length additionalTextEdits)) (eglot--apply-text-edits additionalTextEdits))) (eglot--signal-textDocument/didChange) + (when command + (eglot--dbind ((Command) command arguments) command + (eglot-execute-command server (intern command) argument= s))) (eldoc))))))))) =20 (defun eglot--hover-info (contents &optional _range) ```