Path source should show when only enabled provider
Make sure you have done the following
- [X] Updated to the latest version of
blink.cmp - [X] Searched for existing issues and documentation (try
<C-k>on https://cmp.saghen.dev)
Bug Description
The following keymap will work with most default sources, but not the path one
['<C-b>'] = { function(cmp) cmp.show({ providers = { 'path' } }) end },
I am guessing this might be related to the trigger characters that the path provider possesses.
However, in that case, since we are doing an explicit manual trigger of the provider, this should work and not be reliant on any trigger character.
Relevant configuration
require("blink-cmp").setup({
keymap = {
['<C-b>'] = { function(cmp) cmp.show({ providers = { 'path' } }) end },
},
completion = {
documentation = {
-- Controls whether the documentation window will automatically show when selecting a completion item
auto_show = true,
auto_show_delay_ms = 500,
update_delay_ms = 50,
},
},
sources = {
-- add lazydev to your completion providers
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
},
})
neovim version
NVIM v0.11.0-dev-1471+g64b0e6582a
blink.cmp version
0.10.0
It seems to work, perhaps you're confusing path completions from your LSP with the path source? Or perhaps you're expecting the path completions to show up in a situation that they currently don't (i.e. src/|)? Closing for now since it seems to be working as intended but I'll re-open if you can provide a bit more clarity
@Saghen In your case, does it work even without any trigger character specified?
If I have the following:
Where cursor is at {CURSOR_POSITION}
test = "./{CURSOR_POSITION}"
Then yes it will work because the trigger characters are present before hand.
however, the following:
test = "{CURSOR_POSITION}"
does not work for me. The completion popup will not show.
Basically, what I am looking for is to trigger path completion of the current file directory without having to type ./ for the current directory.
Perhaps there is a better way to go about this, but I was expecting it to work if summoned without any trigger character (i.e.: it would default to the current dir).
I get what you mean now, thanks!
Note to self: Provide the enabled providers as a list in the context?
ran into this issue today as well. It's worth mentioning that I can use <c-x><c-f>(:h i_CTRL-X_CTRL-F) to bring up the path pmenu without it starting with / or ./. But blink path completion doesn't work.
I also tried this but it doesn't work
opts.keymap["<C-x><C-f>"] = { function(cmp) cmp.show({ providers = { "path" } }) end }