You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The definition of fallback_for is if any of these providers return 0 items, it will fallback to this provider.
I think rather than checking if any provider returns 0 items it might be more convenient to check that all providers return 0 items when setting up multiple completion providers.
As an example completion provider lets take crates.nvim which provides version completions in Cargo.toml files. When I use this provider ideally what happens is I do not get buffer items, only the ones returned from crates. Currently the way I would set this up is something like:
However this does not quite work since in Cargo.toml files the lsp provider returns 0 items so the buffer provider will run. Worse though is that in code files with an active LSP the crates provider returns 0 items so the buffer provider will run there as well now.
Ideally there would be a way to specify "only run this provider if non of the others have items". I think this is similar in concept to how nvim-cmp groups work. My idea to make this possible is to simply change the existing fallback_for to an all instead of an any. If this isn't possible than a new mechanism to make this possible would be great, maybe something like ignore_for, where meeting the fallback conditions makes the provider able to run but if any provider in ignore_for has items than it does not get run.
The text was updated successfully, but these errors were encountered:
Large rewrite of how sources are handled, adding support for async providers/timeouts, tree based fallbacks, dynamically adding sources and some other goodies
Closes#386Closes#219Closes#328Closes#331Closes#312Closes#454Closes#444Closes#372Closes#475
Large rewrite of how sources are handled, adding support for async providers/timeouts, tree based fallbacks, dynamically adding sources and some other goodies
Closes#386Closes#219Closes#328Closes#331Closes#312Closes#454Closes#444Closes#372Closes#475
Feature Description
The definition of
fallback_for
isif any of these providers return 0 items, it will fallback to this provider
.I think rather than checking if any provider returns 0 items it might be more convenient to check that all providers return 0 items when setting up multiple completion providers.
As an example completion provider lets take crates.nvim which provides version completions in
Cargo.toml
files. When I use this provider ideally what happens is I do not getbuffer
items, only the ones returned fromcrates
. Currently the way I would set this up is something like:However this does not quite work since in
Cargo.toml
files thelsp
provider returns 0 items so thebuffer
provider will run. Worse though is that in code files with an active LSP thecrates
provider returns 0 items so thebuffer
provider will run there as well now.Ideally there would be a way to specify "only run this provider if non of the others have items". I think this is similar in concept to how
nvim-cmp
groups work. My idea to make this possible is to simply change the existingfallback_for
to anall
instead of anany
. If this isn't possible than a new mechanism to make this possible would be great, maybe something likeignore_for
, where meeting the fallback conditions makes the provider able to run but if any provider in ignore_for has items than it does not get run.The text was updated successfully, but these errors were encountered: