Update Blink config
This commit is contained in:
parent
81d8ac0e84
commit
3f699fde8f
|
@ -8,11 +8,11 @@
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-DuhR3y0gPZG0AJ2FDd+nUKzQMwT+c/DFIUWNDQ5Uyx4=",
|
"narHash": "sha256-DuhR3y0gPZG0AJ2FDd+nUKzQMwT+c/DFIUWNDQ5Uyx4=",
|
||||||
"path": "/nix/store/kiva355rzlqaqhs56h8klkcggdg0wivf-source/home/ags",
|
"path": "/nix/store/v7xsk4kvdnnpj7zvr4bl47wxycbx4qy6-source/home/ags",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/kiva355rzlqaqhs56h8klkcggdg0wivf-source/home/ags",
|
"path": "/nix/store/v7xsk4kvdnnpj7zvr4bl47wxycbx4qy6-source/home/ags",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -33,6 +33,27 @@ return {
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||||
|
transform_items = function(_, items)
|
||||||
|
for _, item in ipairs(items) do
|
||||||
|
local types = require('blink.cmp.types')
|
||||||
|
local map = {}
|
||||||
|
map[types.CompletionItemKind.Text] = -3
|
||||||
|
map[types.CompletionItemKind.Method] = 10
|
||||||
|
map[types.CompletionItemKind.Function] = 9
|
||||||
|
map[types.CompletionItemKind.Field] = 8
|
||||||
|
map[types.CompletionItemKind.Class] = 7
|
||||||
|
map[types.CompletionItemKind.Variable] = 6
|
||||||
|
map[types.CompletionItemKind.Property] = 5
|
||||||
|
|
||||||
|
if map[item.kind] ~= nil then
|
||||||
|
item.score_offset = item.score_offset + map[item.kind]
|
||||||
|
end
|
||||||
|
if item.label:match("^__") then
|
||||||
|
item.score_offset = item.score_offset - 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return items
|
||||||
|
end,
|
||||||
providers = {
|
providers = {
|
||||||
lsp = {
|
lsp = {
|
||||||
async = true,
|
async = true,
|
||||||
|
|
Loading…
Reference in New Issue