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

Prio per snippet and distance to cursor ? #62

Open
MarcWeber opened this issue Feb 14, 2023 · 0 comments
Open

Prio per snippet and distance to cursor ? #62

MarcWeber opened this issue Feb 14, 2023 · 0 comments

Comments

@MarcWeber
Copy link

MarcWeber commented Feb 14, 2023

The keyword snippet is the most often used word.
Yet it doesn't show up first.

If you have code like

snippet is_cross
	stdenv.hostPlatform != stdenv.buildPlatform

and you write one line below starting with i it should find is_cross first
because local or recently defined stuff is very very very very likely to be used again.

Yes, I found function(...) return cmp_buffer:compare_locality(...) end,
but doesn't seem to work. Like its not proposing words nearby but 60 lines apart when starting with chars of a word or is it caused by fuzzy matching ?

So it might even be useful to track recently added texts and take that into account.

Changing = true to + 1 is easy.
What I didn't find is the weight per entry. I only find label = "foo"

Is it already supported that completion entries from a source can have their own weights ?

I nvim-cmp I only find ---@Class lsp.CompletionItem
which doesn't have prio field ?

preselect seems to be closest.

The docs talk about orig_score which seems to be gone in the code.

Anyway cmp/cmp-buffer are very helpful and speed up a lot.

@MarcWeber MarcWeber changed the title Example snippet files Prio per snippet and distance to cursor ? Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant