first try fixing sorting in cmp

This commit is contained in:
Oliver Hartmann 2022-12-01 15:21:43 +01:00
parent 4c3fce3ba2
commit fa5c5f32a4

View File

@ -70,11 +70,11 @@ cmp.setup({
end, end,
}, },
sources = { sources = {
{ name = 'luasnip' }, { name = 'luasnip', priority = 8 },
{ name = 'nvim_lsp' }, { name = 'nvim_lsp', priority = 7},
{ name = 'nvim_lsp_signature_help' }, { name = 'nvim_lsp_signature_help', priority = 7 },
{ name = 'treesitter' }, { name = 'treesitter', priority = 6 },
{ name = 'buffer' }, { name = 'buffer', priority = 5 },
-- { name = 'nvim_lua' }, -- { name = 'nvim_lua' },
-- { name = 'look' }, -- { name = 'look' },
-- { name = 'path' }, -- { name = 'path' },
@ -90,14 +90,16 @@ cmp.setup({
completion = { completeopt = 'menu,menuone,noinsert, noselect' }, completion = { completeopt = 'menu,menuone,noinsert, noselect' },
sorting = { sorting = {
comparators = { comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
require('clangd_extensions.cmp_scores'), require('clangd_extensions.cmp_scores'),
cmp.config.compare.recently_used, cmp.config.compare.locality,
cmp.config.compare.kind, -- cmp.config.compare.recently_used,
cmp.config.compare.sort_text, -- -- cmp.config.compare.offset,
cmp.config.compare.length, -- cmp.config.compare.exact,
cmp.config.compare.order, -- cmp.config.compare.recently_used,
-- cmp.config.compare.kind,
-- cmp.config.compare.sort_text,
-- cmp.config.compare.length,
-- cmp.config.compare.order,
}, },
}, },
-- experimental = { native_menu = true } -- experimental = { native_menu = true }