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.
So this is the issue?
Yeah can you set it to false and see if it is fixed?
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?
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.