[#1] show completion lsp source
This commit is contained in:
parent
6247861f0f
commit
1029099729
1 changed files with 15 additions and 6 deletions
|
|
@ -111,11 +111,18 @@ local cmp = require('cmp')
|
|||
local luasnip = require('luasnip')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
sources = {
|
||||
{ names = 'nvim_lsp', },
|
||||
{ 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,
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
|
|
@ -136,8 +143,10 @@ cmp.setup({
|
|||
end
|
||||
end, { 'i', 's' }),
|
||||
}),
|
||||
sources = {
|
||||
{ names = 'nvim_lsp', },
|
||||
{ names = 'luasnip', }, -- TODO: add snippets
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue