minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
573 stars 20 forks source link

Cape-company-to-capy lists yas-snippets automatically after the spacebar #100

Closed mishrasubhajit closed 6 months ago

mishrasubhajit commented 6 months ago

Hi, first of I am sorry if this is not a github standard issue. However, I am unable to solve this issue for a long time and couldn't find anyone to help me out.

I am on Emacs 29.1 on Windows 11. I use Corfu, orderless, Cape and Eglot immensely in my workflow. And a big thank you for providing these packages. I am writing in LaTeX and have successfully managed to integrate autocompletion. The following is the code for my autocompletion in Eglot.

  (defun my/eglot-capf ()
    (setq-local completion-at-point-functions
                (list (cape-capf-super
                       (cape-capf-prefix-length #'cape-dabbrev 3)
                       #'eglot-completion-at-point 
                       (cape-capf-silent (cape-company-to-capf #'company-yasnippet))
                       #'cape-file
                       ))))

  (add-hook 'eglot-managed-mode-hook #'my/eglot-capf)

As you might have noticed, I have added cape-company-to-capf to transform company-yasnippet and get the auto-completion for yas-snippets. However, the annoying problem is that whenever I add a space while writing, the list of yas-snippet automatically pops up. I have attached a small video to better demonstrate the problem.

https://github.com/minad/cape/assets/13003528/dfc7efb9-c90f-43a8-973b-e6a10d750f84

I have tried to solve the issue in multiple ways but could not find a solution. Either the yas-snippets popup automatically after spacebar, or there is no yas-snippet listing at all. I am probably missing something very silly here. It will be very helpful to get rid of this issue. Please let me know if more information is needed. Thanks a lot.

minad commented 6 months ago

This is difficult for me to debug without a minimal recipe based on emacs -Q which demonstrates the issue. Maybe try https://github.com/elken/yasnippet-capf instead?