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

Sorting is too aggressive instead of favoring "closest" match #365

Closed
2 tasks done
Tesohh opened this issue Nov 23, 2024 · 3 comments
Closed
2 tasks done

Sorting is too aggressive instead of favoring "closest" match #365

Tesohh opened this issue Nov 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Tesohh
Copy link

Tesohh commented Nov 23, 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 recently switched to blink.cmp as nvim-cmp feels too slow.
One thing i miss from nvim-cmp is how good the completions were as they favored the "closest" item.

Here is an example from nvim-cmp using clangd:
image
the results are almost perfect as you can see.

Here is the same example but in blink:
Screenshot 2024-11-23 at 14 04 18

it picks out some functions, but then the types are in alphabetical order which doesn't really make much sense.

I also recreated a similar scenario in fzf and as you can see it picks out int correctly.
Screenshot 2024-11-23 at 14 08 12

(i will add more examples when i have time)

Relevant configuration

opts = {
		keymap = { preset = "enter" },
		highlight = {
			use_nvim_cmp_as_default = true,
		},
		nerd_font_variant = "mono",
		sources = {
			completion = {
				enabled_providers = { "lsp", "path", "snippets", "buffer" },
			},
		},
		accept = { auto_brackets = { enabled = false } },
		trigger = { signature_help = { enabled = true } },
	},

neovim version

v0.10.2

blink.cmp version: branch, tag, or commit

v0.5.1e

@Saghen
Copy link
Owner

Saghen commented Nov 27, 2024

There was a bug causing us to always fuzzy match on the label, which broke the prefix bonus for this LSP since it includes a space/dot icon. We're also now using the hints that LSPs provide for sorting. Hopefully the sorting looks a bit better on main now (you'll need to cargo build --release if you want to test)

@leet0rz
Copy link

leet0rz commented Nov 28, 2024

There was a bug causing us to always fuzzy match on the label, which broke the prefix bonus for this LSP since it includes a space/dot icon. We're also now using the hints that LSPs provide for sorting. Hopefully the sorting looks a bit better on main now (you'll need to cargo build --release if you want to test)

So main has better sorting and all the matches with _ or __ first will not appear first compared to what should show up? Should I just wait for a stable release on this for the sorting to be fixed? Thanks.

@Tesohh
Copy link
Author

Tesohh commented Nov 29, 2024

Switched to main branch and reinstalled, works exactly how i expect it, thanks a lot!

Unrelated but i noticed that all completion items have the same color icon, should i open another issue or is it already in the works (or could it be something with my colorscheme?)
image

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

3 participants