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

Configurable entry scoring #93

Open
1 task done
ibrokemypie opened this issue Oct 7, 2024 · 2 comments
Open
1 task done

Configurable entry scoring #93

ibrokemypie opened this issue Oct 7, 2024 · 2 comments
Assignees
Milestone

Comments

@ibrokemypie
Copy link

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

Love this plugin! Found it right after writing up a note of my own almost word for word matching your design motivatoin section 😄 Have just spent the last hour setting this up to match my cmp configuration and wow is it cleaner, tysm!

One thing that is missing though, as far as I can tell, is a way to configure item level scoring. What I want is to be able to adjust the score of entries depending on things such as (if from an lsp) the kind of the entry and the distance from the cursor of the entry (such as in cmp)

Help

Yes

Implementation help

Would be happy to help if you can point me in the right direction :)

@max397574
Copy link
Owner

Glad you like the plugin
I'm currently busy with uni so I don't have a lot of time to work on this (should get better in the next few weeks)

if you'd like to work on this yourself

you should add a function to the config to which the entry (and perhaps the current context) gets passed
this function gets then should be called in the lua/care/matcher.lua at the end to just add some additional value (or just modify, but then you'd have to pass the fzy score as well) to the score

@max397574 max397574 added this to the v1.0.0 milestone Oct 7, 2024
@max397574
Copy link
Owner

also
didn't take a look at your config
but perhaps your usecase could also be covered by the filter function for sources https://max397574.github.io/care.nvim/config/#filter

see e.g. my config https://github.com/max397574/omega-nvim/blob/c159f42c2aea138d706146f56bcd9fbc4a846881/lua/omega/modules/editor/care.lua#L69

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

2 participants