Skip to content
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

Path source should show when only enabled provider #966

Open
2 tasks done
jemag opened this issue Jan 9, 2025 · 3 comments
Open
2 tasks done

Path source should show when only enabled provider #966

jemag opened this issue Jan 9, 2025 · 3 comments
Labels
bug Something isn't working LSP Related to a specific LSP

Comments

@jemag
Copy link

jemag commented Jan 9, 2025

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • 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

@jemag jemag added the bug Something isn't working label Jan 9, 2025
@Saghen
Copy link
Owner

Saghen commented Jan 13, 2025

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 Saghen closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
@Saghen Saghen added the LSP Related to a specific LSP label Jan 13, 2025
@jemag
Copy link
Author

jemag commented Jan 13, 2025

@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).

@Saghen Saghen reopened this Jan 13, 2025
@Saghen
Copy link
Owner

Saghen commented Jan 13, 2025

I get what you mean now, thanks!

Note to self: Provide the enabled providers as a list in the context?

@Saghen Saghen changed the title cmp.show should work with path provider Path source should show when only enabled provider Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LSP Related to a specific LSP
Projects
None yet
Development

No branches or pull requests

2 participants