max397574 / care.nvim

care.nvim - Completion And Recommendation Engine for Neovim - WIP
GNU General Public License v3.0
90 stars 5 forks source link

Configurable entry scoring #93

Open ibrokemypie opened 3 days ago

ibrokemypie commented 3 days ago

Issues

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 :smile: 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 commented 3 days ago

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 commented 3 days ago

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