mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 09:48:59 +02:00
fix(cmp): properly set cmp group_index
to fix issues with copilot and other sources (#1639)
This commit is contained in:
parent
502d32490b
commit
de93848f58
3 changed files with 8 additions and 9 deletions
|
@ -67,12 +67,12 @@ return {
|
||||||
select = true,
|
select = true,
|
||||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp", group_index = 1 },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip", group_index = 1 },
|
||||||
{ name = "buffer" },
|
{ name = "buffer", group_index = 2 },
|
||||||
{ name = "path" },
|
{ name = "path", group_index = 2 },
|
||||||
}),
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(_, item)
|
format = function(_, item)
|
||||||
local icons = require("lazyvim.config").icons.kinds
|
local icons = require("lazyvim.config").icons.kinds
|
||||||
|
|
|
@ -17,9 +17,8 @@ return {
|
||||||
},
|
},
|
||||||
---@param opts cmp.ConfigSchema
|
---@param opts cmp.ConfigSchema
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
table.insert(opts.sources, 1, { name = "codeium", group_index = 2 })
|
table.insert(opts.sources, 1, { name = "codeium", group_index = 1 })
|
||||||
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
|
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ return {
|
||||||
},
|
},
|
||||||
---@param opts cmp.ConfigSchema
|
---@param opts cmp.ConfigSchema
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
table.insert(opts.sources, 1, { name = "copilot", group_index = 2 })
|
table.insert(opts.sources, 1, { name = "copilot", group_index = 1 })
|
||||||
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
|
opts.sorting = opts.sorting or require("cmp.config.default")().sorting
|
||||||
table.insert(opts.sorting.comparators, 1, require("copilot_cmp.comparators").prioritize)
|
table.insert(opts.sorting.comparators, 1, require("copilot_cmp.comparators").prioritize)
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue