fix(blink.cmp): suggestions priority
- Put the snippets first
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
local source_priority = {
|
||||||
|
|
||||||
|
snippets = 4,
|
||||||
|
lsp = 3,
|
||||||
|
path = 2,
|
||||||
|
buffer = 1
|
||||||
|
|
||||||
|
}
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
-- NOTE: First, some plugins that don't require any configuration
|
-- NOTE: First, some plugins that don't require any configuration
|
||||||
|
|
||||||
@@ -104,7 +112,21 @@ require('lazy').setup({
|
|||||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||||
--
|
--
|
||||||
-- See the fuzzy documentation for more information
|
-- See the fuzzy documentation for more information
|
||||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
fuzzy = {
|
||||||
|
implementation = "prefer_rust_with_warning",
|
||||||
|
sorts = {
|
||||||
|
function(a, b)
|
||||||
|
local a_priority = source_priority[a.source_id];
|
||||||
|
local b_priority = source_priority[b.source_id];
|
||||||
|
if a_priority ~= b_priority then
|
||||||
|
return a_priority > b_priority
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
-- default
|
||||||
|
'score',
|
||||||
|
'sort_text'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
opts_extend = { "sources.default" }
|
opts_extend = { "sources.default" }
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user