Closed lynnux closed 1 year ago
Thanks for the report! Please check that f4ed6f198d5995e693bf452e875b2b09469fccfb fixes the issue for you.
Thanks for the fix, it's OK when press Enter
(corfu-insert
), but get same output when press TAB
(corfu-complete
), but no error message Args out of range: 0, 0
anymore. It's still OK when press TAB
to completion without cape.
Thanks for confirming.
The problem with TAB seems to be here that Corfu doesn't call the :exit-function
to fix the candidate. Ideally the backend wouldn't produce such invalid candidates which would require fixing afterwards. You can check why corfu--done
is not called at one of the following locations in corfu-complete
. corfu--done
should then in turn call :exit-function
which will fix the candidate.
https://github.com/minad/corfu/blob/5daeb9c5b76243ea5b2d6d3dd5692e4eefda4f4b/corfu.el#L1196
https://github.com/minad/corfu/blob/5daeb9c5b76243ea5b2d6d3dd5692e4eefda4f4b/corfu.el#L1204
https://github.com/minad/corfu/blob/5daeb9c5b76243ea5b2d6d3dd5692e4eefda4f4b/corfu.el#L1216
As you wrote above, the round dot issue is unrelated to this Cape issue.
If I comment out (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster), there still have round dot in corfu items, but will not get error message Args out of range: 0, 0 and the output will also not have round dot.
Sorry, I'm not quite understanding the lisp code, I can only write some emacs lisp config code.
But without cape, although corfu show round dot, the completion/output will not have round dot after Enter
or 'TAB', so I think the items handled by cape-wrap-buster
may have some little difference from original.
Okay, please try the commit https://github.com/minad/cape/commit/12b157b0e3367504d4267c3b3977850e588e463e (separate branch) and let me know if this works.
It's still the same that Enter
ok and TAB
not work.
I don't quite unstand the difference between corfu-insert
and corfu-complete
, for me they like the same, a workaround is rebind TAB
to corfu-insert
:
(define-key corfu-map (kbd "<tab>") 'corfu-insert)
(define-key corfu-map (kbd "TAB") 'corfu-insert)
And I find out that: TAB
will not have the round dot if the complition call yas-expand-snippet
, like this:
but will have the round dot if don't call
yas-expand-snippet
, like this:
Hi @minad , thanks for new tips in https://github.com/minad/corfu/wiki#1-mode-use-eglot-to-provide-continuously-updated-candidates, I really need this feature for code completion. But I got error message
if I press enter, the output will be:
There should not have a round dot before
Args out of range: 0, 0
when I choose item in front of which has a round dot. like this:ICreateErrorInfo
, I think this error is from this config:If I comment out
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
, there still have round dot in corfu items, but will not get error messageArgs out of range: 0, 0
and the output will also not have round dot.More details if M-x with![image](https://user-images.githubusercontent.com/367894/231671261-940d7fe9-c02a-44a5-b431-d22194d6c35a.png)
toggle-debug-on-error
:And this is the minmal config:
Emacs version: "30.0.50", window 64bit, eglot with clangd, latest corfu and cape.