# How to make yasnippets show up in the completion menu while using sly?

**URL:** https://forum.systemcrafters.net/t/how-to-make-yasnippets-show-up-in-the-completion-menu-while-using-sly/1229
**Category:** Emacs Lisp
**Created:** [December 24, 2024, 6:25am UTC](https://forum.systemcrafters.net/t/how-to-make-yasnippets-show-up-in-the-completion-menu-while-using-sly/1229 "2024-12-24T06:25:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)
#### Post date: [December 24, 2024, 6:25am UTC](https://forum.systemcrafters.net/t/how-to-make-yasnippets-show-up-in-the-completion-menu-while-using-sly/1229/1 "2024-12-24T06:25:40Z")

</div>

I would like my yasnippets to show up at the top of the autocompletion popup when I use sly, but haven’t been able to figure out how to do so… I’m using the systemcrafters config with corfu for autocompletion, and this is my yasnippet config:

```auto
(use-package yasnippet
  :ensure t
  :bind (("C-c C-<return>" . #'yas-expand))
  :config
  (add-to-list 'yas-snippet-dirs "~/dots/emacs/snippets")
  (yas-global-mode 1))
(use-package yasnippet-capf
  :ensure t
  :after cape
  :config
  (add-to-list 'completion-at-point-functions #'yasnippet-capf))

```

The snippets do work, and they show up in some modes (org, elisp, sclang), but not in lisp mode when using sly.

Any help much appreciated!

---

<div class="post-metadata">

### Author: ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)
#### Post date: [December 25, 2024, 9:56am UTC](https://forum.systemcrafters.net/t/how-to-make-yasnippets-show-up-in-the-completion-menu-while-using-sly/1229/2 "2024-12-25T09:56:44Z")

</div>

OK, getting a bit further here… For some reason yasnippet is not added to `completion-at-point-functions`. The value of this in a lisp buffer is

```common-lisp
(sly-complete-filename-maybe
 sly-complete-symbol)

```

If I run `(add-to-list 'completion-at-point-functions #'yasnippet-capf)` manually it becomes

```common-lisp
(yasnippet-capf
 sly-complete-filename-maybe
 sly-complete-symbol)

```

but then I _only_ get the yasnippet completion. The sly-complete-\* functions no longer show in the completion popup.

---

<div class="post-metadata">

### Author: ![hao](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hao](https://forum.systemcrafters.net/u/hao)
#### Post date: [January 21, 2025, 8:36pm UTC](https://forum.systemcrafters.net/t/how-to-make-yasnippets-show-up-in-the-completion-menu-while-using-sly/1229/3 "2025-01-21T20:36:03Z")

</div>

I think some completion-at-point-functions “short-circuit” everything else and so you don’t get to see other possible completions. Have you tried [GitHub - minad/cape: 🦸cape.el - Completion At Point Extensions](https://github.com/minad/cape?tab=readme-ov-file#super-capf---merging-multiple-capfs) merging multiple capfs together via the cape package? This worked for me when I was playing around with merging yasnippets with everything else.

---

<div class="post-metadata">

### Author: ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)
#### Post date: [January 23, 2025, 7:51am UTC](https://forum.systemcrafters.net/t/how-to-make-yasnippets-show-up-in-the-completion-menu-while-using-sly/1229/4 "2025-01-23T07:51:37Z")

</div>

Thanks! Will give it a try when I have a bit more time.
