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

Name collision with nvim vim.api.keyset.keymap #767

Closed
2 tasks done
yowu opened this issue Dec 25, 2024 · 2 comments
Closed
2 tasks done

Name collision with nvim vim.api.keyset.keymap #767

yowu opened this issue Dec 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@yowu
Copy link

yowu commented Dec 25, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

The locally defined class vim.api.keyset.keymap has a name collision with the original nvim version. This results in diagnostic errors when blink.cmp is added to the workspace library.

---@class vim.api.keyset.keymap

https://github.com/neovim/neovim/blob/master/runtime/lua/vim/_meta/api_keysets.lua#L189

Relevant configuration

No response

neovim version

v0.10.3

blink.cmp version: branch, tag, or commit

v0.8.2

@yowu yowu added the bug Something isn't working label Dec 25, 2024
@mikavilpas
Copy link
Contributor

Looks like they were added in 8b553f6

I wonder if this is specific to some version of neovim. What are the errors you see? Where do you see them?

@yowu
Copy link
Author

yowu commented Dec 25, 2024

This is a diagnostic error, not a real one. I use AstroNvim and it uses nvim built in vim.api.keyset.keymap to type some fields in it.

https://github.com/AstroNvim/astrocore/blob/main/lua/astrocore/config.lua#L12

The name collision happens if I include blink.cmp in my Lua workspace library. Then there are bunch of diagnostics errors from lua_ls as it tries to map my config entries to blink defined one.

It's a minor issue and I haven't checked other Neovim versions. But I believe the one in blink should be named within its own namespace to avoid conflicts with Neovim's built-in names.

@Saghen Saghen closed this as completed in 63718e9 Dec 25, 2024
hfn92 pushed a commit to hfn92/blink.cmp that referenced this issue Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants