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: Wed, 15 Feb 2023 13:34:32 +0100	[thread overview]
Message-ID: <875yc3qf8n.fsf@thornhill.no> (raw)
In-Reply-To: <87v8k3st80.fsf@gmail.com>

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

> Theodor Thornhill <theo@thornhill.no> 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:
>  
>  ...
>  (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án'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ão

Theo





  reply	other threads:[~2023-02-15 12:34 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 [this message]
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
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=875yc3qf8n.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).