Skip to content

Commit

Permalink
vim: Display the name of LSP server for each completion item.
Browse files Browse the repository at this point in the history
  • Loading branch information
wookayin committed Feb 8, 2022
1 parent 6b1b8f7 commit 173cf6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nvim/lua/config/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,15 @@ cmp.setup {
ultisnips = "[UltiSnips]",
nvim_lua = "[Lua]",
latex_symbols = "[Latex]",
})[entry.source.name]
})[entry.source.name] or string.format("[%s]", entry.source.name)

if vim_item.menu == "[LSP]" then
-- Display which LSP servers this item came from.
pcall(function()
vim_item.menu = " " .. entry.source.source.client.name
end)
end

return vim_item
end,
},
Expand Down

0 comments on commit 173cf6a

Please sign in to comment.