unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: Felician Nemeth <felician.nemeth@gmail.com>, 61506@debbugs.gnu.org
Subject: bug#61506: 30.0.50; [PATCH]: Send command in eglot completion exit-function
Date: Mon, 20 Feb 2023 15:13:36 +0100	[thread overview]
Message-ID: <874jrga0hb.fsf@thornhill.no> (raw)
In-Reply-To: <CALDnm52hnQLsprTwZZwNo=2sN=bS_=+xbpvvYLVQYRWetayzRg@mail.gmail.com> ("João Távora"'s message of "Sat, 18 Feb 2023 23:23:41 +0000")

João Távora <joaotavora@gmail.com> writes:

> On Sat, Feb 18, 2023 at 10:20 PM Theodor Thornhill <theo@thornhill.no> wrote:
>
>  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 
> I'll be happy to review a patch adding this to Eglot.  
>
> I share with Felician a concern: if the notification can be sent from the exit-function 
> it's one thing, and the patch is possibly a one or two-liner.  If, OTOH, the notification 
> has to be sent after the didChange that follows a completion choice, then it's 
> 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-window))
                                   (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) arguments)))
                (eldoc)))))))))
 
 (defun eglot--hover-info (contents &optional _range)
```





  reply	other threads:[~2023-02-20 14:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 11:00 bug#61506: 30.0.50; [PATCH]: Send command in eglot completion exit-function Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-14 15:56 ` Felician Nemeth
2023-02-14 17:44   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-14 23:49     ` João Távora
2023-02-15 12:34       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-18 22:20         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-18 23:23           ` João Távora
2023-02-20 14:13             ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-02-15 11:51     ` Felician Nemeth
2023-02-15 12:24       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-11 15:12       ` Felician Nemeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jrga0hb.fsf@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=61506@debbugs.gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=joaotavora@gmail.com \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).