-
Notifications
You must be signed in to change notification settings - Fork 187
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
Source priority
#1098
Comments
I believe you can accomplish this with sources.providers.score_offset. See https://cmp.saghen.dev/configuration/reference.html#providers, and #1096. |
You may also achieve this with a custom sort function local source_priority = {
snippets = 4,
lsp = 3,
path = 2,
buffer = 1
}
fuzzy.sorts = {
function(a, b)
return source_priority[a.source_id] > source_priority[b.source_id]
end,
-- defaults
'score',
'sort_text'
} |
@Saghen Just to clarify, I had to replace the Thank you so much for all the work you put in to this package! ❤️ |
Fixed, thank you! |
I want to be able to choose which order suggestions appear based on their source. Specifically, I want any snippets that match to appear higher than anything else, the idea being that if I have a snippet that matches, it's because I manually created one for that specific use case.
What I don't understand is how I'd actually go about setting the order.
In my config, I already have:
with
"snippets"
being at the front of the line, but this seems to make no difference to where the suggestions actually end up.Is there something I'm doing wrong here?
The text was updated successfully, but these errors were encountered: