Debugging Corfu
Corfu will automatically print a stack trace to the ‘*Messages*’ buffer when an error is detected. The stack trace allows you to narrow down the exact code location which caused the error.
When Capfs do not yield the expected result, you can wrap a Capf with cape-capf-debug from the Cape package, creating a new Capf, which adds completion log messages for debugging. The completion log messages are added to the ‘*Messages*’ buffer.
emacs-lisp
(setq completion-at-point-functions (list (cape-capf-debug #'cape-dict)))Sometimes you will find errors inside Capfs. Such errors are bugs in the Capfs must be fixed there, since Corfu cannot work around them.