Squashed commit of the following:
commit 1029099729
Author: Sonny Bakker <sonny871@hotmail.com>
Date: Sat Aug 24 09:54:59 2024 +0200
[#1] show completion lsp source
This commit is contained in:
parent
6247861f0f
commit
3c3b3952b4
1 changed files with 15 additions and 6 deletions
|
|
@ -111,11 +111,18 @@ local cmp = require('cmp')
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
sources = {
|
||||||
expand = function(args)
|
{ names = 'nvim_lsp', },
|
||||||
luasnip.lsp_expand(args.body)
|
{ names = 'luasnip', }, -- TODO: add snippets
|
||||||
|
},
|
||||||
|
|
||||||
|
formatting = {
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
vim_item.menu = string.format('[%s]', entry.source.source.client.name)
|
||||||
|
return vim_item
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
|
|
@ -136,8 +143,10 @@ cmp.setup({
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { 'i', 's' }),
|
||||||
}),
|
}),
|
||||||
sources = {
|
|
||||||
{ names = 'nvim_lsp', },
|
snippet = {
|
||||||
{ names = 'luasnip', }, -- TODO: add snippets
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue