Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
631 stars 26 forks source link

Buffer completion not working... Why? #59

Open vinoff opened 1 day ago

vinoff commented 1 day ago

I like writing on Markdown files. However, it seems like blink does not suggest completions of current words. It works for snippets, but not for normal words... Am I doing something wrong?

The same is happening for .txt files, of course.

Basically, Imagine I following text on a .txt file:

"Today is going to be raining a lot. You should bring an umbrella."

When writing a new line and I writing "rain", it should show up "raining" as an auto-complete option. Or "umb" should show "umbrella". That is not happening.

caliguIa commented 21 hours ago

I am also getting this in many different filetypes. One thing I've also noticed, is if I'm typing a variable name in a string to print it it doesn't offer the variable name as an option, outside of a string it will.

rawhat commented 13 hours ago

I can't speak to the string thing, but I think the original issue is related to how the provider groups work. If you look at the default config:

    -- vvv this line in particular
    -- multiple groups can be provided, where it'll fallback to the next group if the previous
    -- returns no completion items
    -- WARN: This API will have breaking changes during the beta
    providers = {
      {
        { 'blink.cmp.sources.lsp' },
        { 'blink.cmp.sources.path' },
        { 'blink.cmp.sources.snippets', score_offset = -3 },
      },
      { { 'blink.cmp.sources.buffer' } },
    },

Because the buffer provider is in the second group, if any of the sources in the first group provide a completion (i.e. your snippets here), it will not provide completions from the buffer. You could move it up into that first group and it should work.

Saghen commented 11 hours ago

Yep that's the case. I'm planning to switch to fallbacks for specific sources. I.e. the buffer source would show when the LSP source returns no items