Update Blink config

This commit is contained in:
Thomas Avé 2024-12-20 03:15:00 +01:00
parent 81d8ac0e84
commit 3f699fde8f
2 changed files with 23 additions and 2 deletions

View File

@ -8,11 +8,11 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-DuhR3y0gPZG0AJ2FDd+nUKzQMwT+c/DFIUWNDQ5Uyx4=",
"path": "/nix/store/kiva355rzlqaqhs56h8klkcggdg0wivf-source/home/ags",
"path": "/nix/store/v7xsk4kvdnnpj7zvr4bl47wxycbx4qy6-source/home/ags",
"type": "path"
},
"original": {
"path": "/nix/store/kiva355rzlqaqhs56h8klkcggdg0wivf-source/home/ags",
"path": "/nix/store/v7xsk4kvdnnpj7zvr4bl47wxycbx4qy6-source/home/ags",
"type": "path"
}
},

View File

@ -33,6 +33,27 @@ return {
},
sources = {
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 = {
lsp = {
async = true,