-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu customization API #11
Comments
Are you using custom window to display completion candidates in cmp or standard vim/nvim one? |
Haha, Currently nvim-cmp uses vim's native completion menu. But my next task after nvim-cmp stabilized is it! I will use a custom completion menu via the floating window. (It realizes custom highlighting.) |
Sounds pretty cool! Will there then also be an option to just use the regular neovim completion menu? |
Sounds like you'd have to maintain two implementations to do that, one that conforms to the requirements of nvim's completion menu and one to a custom popup. I'm nowhere near the code but seems like it'd be easier to just add configuration options for whatever a person might want to disable/enable rather than implement/maintain both styles |
Yeah, that's what I meant |
vim.lsp.protocol.CompletionItemKind = {
'', -- Text = 1;
'', -- Method = 2;
'ƒ', -- Function = 3;
'', -- Constructor = 4;
'⌘', -- Field = 5;
'', -- Variable = 6;
'', -- Class = 7;
'ﰮ', -- Interface = 8;
'', -- Module = 9;
'', -- Property = 10;
'', -- Unit = 11;
'', -- Value = 12;
'了', -- Enum = 13;
'', -- Keyword = 14;
'', -- Snippet = 15;
'', -- Color = 16;
'', -- File = 17;
'', -- Reference = 18;
'', -- Folder = 19;
'', -- EnumMember = 20;
'', -- Constant = 21;
'', -- Struct = 22;
'', -- Event = 23;
'', -- Operator = 24;
'', -- TypeParameter = 25;
}
local cmp = require('cmp')
for index, value in ipairs(vim.lsp.protocol.CompletionItemKind) do
cmp.lsp.CompletionItemKind[index] = value
end
a little snippet to implement lsplkind on nvim-cmp |
great i am using it this way to show icon + text for index, value in ipairs(vim.lsp.protocol.CompletionItemKind) do
cmp.lsp.CompletionItemKind[index] = value .. ' ' .. cmp.lsp.CompletionItemKind[index]
end |
I've added the API for it. see |
From #10, #7
The text was updated successfully, but these errors were encountered: