Skip to content

Bug: fallback_for = {} completely disables the source #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chrisgrieser opened this issue Oct 16, 2024 · 1 comment
Closed

Bug: fallback_for = {} completely disables the source #122

chrisgrieser opened this issue Oct 16, 2024 · 1 comment

Comments

@chrisgrieser
Copy link
Contributor

In a recent update, the providers settings changed for the buffer-source, adding the fallback_for option.

While useful in principle, I personally prefer to have buffer to simply show its suggestions with lower priority instead of completely ignoring them in the presence of an LSP. I assumed that fallback_for could be disabled by passing an empty table:

sources = {
	providers = {
		{ "blink.cmp.sources.lsp", name = "LSP" },
		{ "blink.cmp.sources.path", name = "Path" },
		{ "blink.cmp.sources.snippets", name = "Snippets" },
		{
			"blink.cmp.sources.buffer",
			name = "Buffer",
			score_offset = -3,
			fallback_for = {}, -- empty to disable
		},
	},
},

But this is apparently not the case. With this config, I simply never get any buffer-suggestions. Whatever I tried, I could not figure out how to display buffer suggestions when there is also an LSP active.

A hacky workaround I found is to use fallback_for = { "Path" }, which effectively enables the buffer-source in most cases, since path does not return anything there is no /. But yeah, it's really a hacky workaround.

@chrisgrieser
Copy link
Contributor Author

it appears completely leaving out fallback_for does the trick:

{
	"blink.cmp.sources.buffer",
	name = "Buffer",
	score_offset = -3,
},

I leave this issue open, since fallback_for = {} disabling the source completely nonetheless feels like a bug. Arguably it's maybe also a documentation issue, since it wasn't apparent from the default config, that you should simply leave out fallback_for

@chrisgrieser chrisgrieser changed the title Bug: not able to disable fallback_for for buffer source. Bug: fallback_for = {} completely disables the source Oct 16, 2024
@Saghen Saghen closed this as completed in 9c9e0cc Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant