Eglot inserts rest of completion twice #400
Replies: 7 comments 11 replies
-
Hi, can you please provide a precise recipe starting from emacs -Q which demonstrates the issue? Also make sure that everything is configured properly, see https://github.com/minad/corfu/wiki#configuring-corfu-for-eglot. Which precise version of Corfu do you use? Maybe this behavior has been introduced recently, in particular by 7ea1e42? Please check if this behavior also happens with the cache buster: (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster) |
Beta Was this translation helpful? Give feedback.
-
This problem happened to me as well. The following trace was obtained using In my test case, I typed And I can also confirmed that by removing
|
Beta Was this translation helpful? Give feedback.
-
I trimmed the config and can reproduce the problem using the following procedure. Hopefully it will be helpful to @minad.
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(use-package rust-mode :ensure t)
(use-package cape :ensure t)
(use-package corfu :ensure t)
(global-corfu-mode t)
(setq corfu-auto t)
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
However, if you remove |
Beta Was this translation helpful? Give feedback.
-
I've occasionally seen this, but (I think) only when completing inside an existing word with dabbrev, ala:
I also wrap, but only with the less aggressive cache-dumper based on string prefix: (cape-capf-buster #'eglot-completion-at-point #'string-prefix-p) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I still advise checking the eglot events buffer as I mentioned above, and comparing the content of the |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm having trouble debugging an issue I am facing with corfu.
When I have text "ab" with available completion "abcd" and I hit TAB (
corfu-complete
), I end up with "abcdcd" instead of "abcd" with the cursor between the "cd"s (i.e.: "abcd|cd"). It is visible that the first insertion happens before the cursor and then the second after the cursor.This occurs with the Eglot capf but not with cape-dabbrev or cape-file. I have not tested others.
This only happens with TAB (
corfu-complete
), but not with RET (corfu-insert
).I've tested with orderless and without, happens in both cases.
I am on Emacs 29.
Is there other steps I should take to debug this issue or is there more information that would be helpful?
Beta Was this translation helpful? Give feedback.
All reactions