From: "João Távora" <joaotavora@gmail.com>
To: Theodor Thornhill <theo@thornhill.no>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Augusto Stoffel <arstoffel@gmail.com>
Cc: 61532@debbugs.gnu.org
Subject: bug#61532: 30.0.50; [PATCH]: Make completions without sortText fall to back of the list
Date: Sun, 19 Feb 2023 18:19:02 +0000 [thread overview]
Message-ID: <CALDnm50iKj5rtrfjE1yMyEuHJqt0xpZt-v_dirMZ3Fnqd=y=Ag@mail.gmail.com> (raw)
In-Reply-To: <348D7924-284D-4D14-882E-02C8CAD7A925@thornhill.no>
[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]
On Sun, Feb 19, 2023 at 4:08 PM Theodor Thornhill <theo@thornhill.no> wrote:
>
>
> >bug tracker list. Next time, you can add me to the special X-Debbugs-CC:
> >header]
> Pretty sure I did that, but it doesn't matter :)
[ I didn't get the message. I went to look in the mbox file off Debbugs and
I did
find a 'X-Debbugs-Cc' header, but maybe it has to be 'X-Debbugs-CC'?]
> I don't think it's a bug, really. Isn't it just the flex style greediness?
The 'flex' completion style isn't really doing (or at shouldn't be doing)
what it does normally. Its purpose in Eglot is only to allow for flex-style
fontification of the pattern to happen. Nothing more, and that includes
no sorting.
That's because, contrary to the normal uses of flex, here it's the
server which does all the selection and the filtering for whatever
it thinks is a pattern. It turns out that a very common style of filtering
among servers is akin to 'flex', so using flex on our side to "paint"
the pattern in the completion candidate is usually, though not always,
a good bet. If the server happens to use 'prefix' ,then 'flex' will also
paint it correctly, in principle. This is of course presuming we guess
the filter pattern that the server used, which we're not guaranteed
to, but more or less always do by looking for a 'symbol' thing-at-point.
Anyway, flex shouldn't be doing any kind of completion sorting for
eglot-completion-at-point. So if it is doing that, it's IMO a bug (though
perhaps not a serious one, as it wouldn't be a very absurd sorting
anyway).
> It feels like it tries to match the longest string possible
alphabetically? It's
> just unintuitive because the json results doesn't match the output, and
> debug stepping over was very unhelpful. We could maybe just add
> some docs explaining that eglot default, which for many really is an
eglot
> hard-coding.
I hope I explained why it's there. This is what I recall of it, though
I may be misremembering. You could help improve the documentation
by confirming my recollection hypothesis and adding comments to the
code.
Anyway, this boils down to a limitation of LSP, that it doesn't report on
what
kind of matching style it uses for textDocument/completion. At least it
used to be a limitation of LSP, maybe someone else has fixed it in the
meantime, or added something that we can use.
João
PS: Added Stefan and Augusto to the discussion since I think they are
already familiar with this LSP/Emacs discrepancy regarding completion
systems and completion philosophy.
[-- Attachment #2: Type: text/html, Size: 3129 bytes --]
next prev parent reply other threads:[~2023-02-19 18:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 14:52 bug#61532: 30.0.50; [PATCH]: Make completions without sortText fall to back of the list Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-18 22:18 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 11:13 ` João Távora
2023-02-19 16:08 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 18:19 ` João Távora [this message]
2023-02-19 18:43 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 18:48 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 22:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 23:39 ` João Távora
2023-02-19 23:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 18:52 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 22:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-21 8:24 ` Augusto Stoffel
2023-02-21 8:24 ` Augusto Stoffel
2023-02-21 12:47 ` João Távora
2023-02-21 14:08 ` Augusto Stoffel
2023-02-21 14:28 ` João Távora
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALDnm50iKj5rtrfjE1yMyEuHJqt0xpZt-v_dirMZ3Fnqd=y=Ag@mail.gmail.com' \
--to=joaotavora@gmail.com \
--cc=61532@debbugs.gnu.org \
--cc=arstoffel@gmail.com \
--cc=monnier@iro.umontreal.ca \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.