this post was submitted on 29 Nov 2023
1 points (100.0% liked)
Emacs
311 readers
1 users here now
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
As long as the completions have the same annotation (the text in green) and same kind (the icon on the left), they are deduplicated.
Looks like perhaps lsp-mode generates annotations that are more useful for your scenario than the ones that eglot does. If that is the case (and not, maybe, that you have configured lsp-mode/eglot to use different language servers), I suggest filing an issue. This shouldn't take too much time to change.
/u/hvis Would you consider changing this, since this way of deduplication in the frontend is quite inefficient? Given that the default completion UI demands that candidates are unique with respect to
equal
and even deletesequal
duplicates, the backend should better produce unique candidates.Deduplicating in the backend is not difficult, all that is needed is adding a suffix like (1), (2), (3), ... In fact, this is what I am doing in my Consult package, which also is a backend and provides completion tables. For example for the
consult-line
command I was facing the same issue, that candidates must be unique with respect toequal
and not toeq
.cc /u/JDRiverRun
I simply consider it part of the requirements (see the other message). And there has been some effort made to ensure that the annotation/kind functions are only called when equal strings are encountered.
Indeed, when the list is long deduplication does show up on the graph, but the impact also depends on the shape of the data, and there probably are some untapped code optimizations still.
I'm not sure this is very easy (e.g. for LSP clients), and in general it would require a scan across all completions of comparable complexity. Also, showing method overloads with suffixes like 1/2/3 would look rather odd, I think.