saadparwaiz1/cmp_luasnip

Sources appear in `LuaSnipListAvailable` but not in cmp suggestions list

bennypowers opened this issue · 10 comments

Hey I've got a bunch of snips in LuaSnipListAvailable like this one:

{
      description = { "Alert - Info background" },
      name = "rh-color-blue-50",
      regTrig = false,
      trigger = "--rh-color-blue-50",
      wordTrig = true
}

loaded via

require 'luasnip.loaders.from_vscode'.lazy_load { paths = {
  '~/Developer/redhat-ux/red-hat-design-tokens/editor/vscode'
} }

sources config is

  sources = cmp.config.sources({
    { name = 'nvim_lsp' },
    { name = 'nvim_lsp_signature_help' },
  }, {
    { name = 'luasnip', option = { use_show_condition = false } },
  }, {
    { name = 'treesitter' },
    { name = 'buffer', keyword_length = 3 },
  }, {
    { name = 'plugins' },
    { name = 'nvim_lua' },
    { name = 'npm', keyword_length = 4 },
    { name = 'fish' },
    { name = 'calc' },
    { name = 'emoji' },
  }),

but none of them are showing up when i type --rh-color. Y?

config: https://github.com/bennypowers/dotfiles/blob/master/.config/nvim/lua/config/cmp.lua
vscode extension bundle: https://github.com/RedHat-UX/red-hat-design-tokens/releases/tag/v1.0.0-beta.9

I want to kindly bump this issue, since I have the same problem 😕

Are you using the native cmp pop up menu or the floating window?

native menu doesn't work with characters that are not alphabetical. So if you change the trigger to remove any non alphabetical characters it should work.

For me it was another issue, I am just writing it here in case anybody else experiences the same issue:

I wanted to use my ultisnip snippets, and they have a different format... After I realized that I misread the luasnip documentation and wrote the snippets wrong:

snippet php vd
    var_dump($0);die();

In the documentation it looked to me like I need to set the language after the snippet keyword, which is not the case.

@bennypowers can you confirm if turning the native menu off fixed the issue for you?

This didn't help, neither did removing the dash chars from the snippet names:

Screenshot from 2022-10-31 14-36-32
Screenshot from 2022-10-31 14-33-12
Screenshot from 2022-10-31 14-33-04

I have this problem with all my snippets, whether defined as lua snippets, snipmate, whatever.

If i restart nvim, I can see ONLY my snipmate snippets in the popup menu for one or two seconds, until the typescript lsp server comes online. After which, the snipmate snippets disappear and are replaced by LSP snippets - at that point, ONLY LSP snippets are available.

Screencast.from.2023-01-08.09-49-03.webm

I also seem to be having this issue 🤔 Mappings that start with non-alphabetical characters (e.g <) don't seem to work. I say the comment above about this being expected for the native menu. However, I didn't set this option anywhere. The only reference I see is outlined in the nvim-cmp wiki but it's an experimental feature that I haven't enabled.

Happy to help with any debugging! I could use a bit of assistance with where to look though.