Skip to content

Error while accepting a completion #348

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
2 tasks done
lateef-k opened this issue Nov 19, 2024 · 2 comments
Closed
2 tasks done

Error while accepting a completion #348

lateef-k opened this issue Nov 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@lateef-k
Copy link

lateef-k commented Nov 19, 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

I was trying to accept an suggestion that will result in an auto-import. It was a python class from another file. If I manually write the import statement, the autocomplete works fine.

.../nvim/lazy/blink.cmp/lua/blink/cmp/accept/text-edits.lua:49: bad argument #2 to 'str_byteindex' (number
 expected, got string)

Relevant configuration

{
		"saghen/blink.cmp",
		lazy = false, -- lazy loading handled internally
		-- optional: provides snippets for the snippet source
		dependencies = "rafamadriz/friendly-snippets",

		-- use a release tag to download pre-built binaries
		build = "nix run .#build-plugin",

		opts = {
			keymap = {
				["<C-p>"] = { "select_prev", "fallback" },
				["<C-n>"] = { "select_next", "fallback" },
				["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
				["<Tab>"] = { "snippet_forward", "fallback" },
				["<S-Tab>"] = { "snippet_backward", "fallback" },
				["<Esc>"] = { "hide", "fallback" },
				["<CR>"] = { "accept", "fallback" },
				["<C-CR>"] = { "select_and_accept", "fallback" },
				["<C-b>"] = { "scroll_documentation_up", "fallback" },
				["<C-f>"] = { "scroll_documentation_down", "fallback" },
			},
			highlight = {
				use_nvim_cmp_as_default = true,
			},
			windows = {
				documentation = {
					auto_show = true,
				},
			},
			nerd_font_variant = "mono",
			-- experimental auto-brackets support
			-- accept = { auto_brackets = { enabled = true } }
			-- experimental signature help support
			-- trigger = { signature_help = { enabled = true } }
		},
		-- allows extending the enabled_providers array elsewhere in your config
		-- without having to redefining it
		opts_extend = { "sources.completion.enabled_providers" },
	},

neovim version

NVIM v0.11.0-nightly+852954f

blink.cmp version: branch, tag, or commit

91ea929

@lateef-k lateef-k added the bug Something isn't working label Nov 19, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 20, 2024

I'm not running nightly myself but you may be running a version of nightly from before the str_byteindex changes were merged: neovim/neovim#30735

You could try running blink from before #308 if updating isn't an option

AndreasNasman added a commit to AndreasNasman/.config that referenced this issue Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature.
AndreasNasman Andreas Näsman
I couldn't get blink.cmp working with the development version of Neovim,
so I switched to the stable version.
Saghen/blink.cmp#348

I'm not actually sure why I was using the development version in the
first place.
@Saghen
Copy link
Owner

Saghen commented Nov 27, 2024

Confirmed from your commit hash that this is the case

you may be running a version of nightly from before the str_byteindex changes were merged: neovim/neovim#30735

@Saghen Saghen closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 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