-
Notifications
You must be signed in to change notification settings - Fork 3
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
Can this be combined with lspkind? #4
Comments
Hey ! It should be great to get this functionality to combine tailwindcss-colorizer-cmp with lspkind. Thanks ! [Edit]: I am not sure but you can look into this: onsails/lspkind.nvim#30 I will try to find out how to integrate both together on the next weeks. |
Thank you for opening this issue! I don't have the ability to test this but I think you can probably just do: |
Thanks for the fast reply ! It's seens working 👍🏼 This is my config for local tail_col_cmp_ok, tailwindcss_colorizer_cmp = pcall(require, "tailwindcss-colorizer-cmp")
if not tail_col_cmp_ok then
return
end
...
formatting = {
fields = {
cmp.ItemField.Menu,
cmp.ItemField.Abbr,
cmp.ItemField.Kind,
},
format = lspkind.cmp_format({
mode = "symbol_text",
menu = {
buffer = "[BUF]",
nvim_lsp = "[LSP]",
nvim_lua = "[LUA]",
path = "[PATH]",
luasnip = "[SNIP]",
},
before = tailwindcss_colorizer_cmp.formatter,
}),
}, But I think we can go further to integrate it better with |
@roobert It works well, thank you! I'm interested to know what happens if we need yet another formatter to be included in the future since it seems only one function can be added to the Thanks again for your help! |
Same question on my side 😄 We need to find a workaround to integrate it better with |
I am also interested in whether supplying multiple functions to format the completions is possible. I'll do some more experimentation and see if it's possible. Otherwise, perhaps opening an issue against Let's leave this issue open for the next week and see if we can solve it. 👍 |
I just did this: formatting = {
format = require('lspkind').cmp_format({
mode = 'symbol_text',
maxwidth = 50,
ellipsis_char = '...',
before = function (entry, vim_item)
vim_item = require('tailwindcss-colorizer-cmp').formatter(entry, vim_item)
return vim_item
end
})
} Looks pretty much like @Flo-Slv's result. Did I do it right? |
This doesn't seem to work if you set the -- ...
formatting = {
format = require('lspkind').cmp_format({
before = require('tailwindcss-colorizer-cmp').formatter,
mode = 'symbol',
}),
}
-- ... 'symbol_text', 'text', and 'text_symbol' modes work but 'symbol' does not. If you set the mode to 'symbol' like above, you just get a blank square. edit This may be an issue with lspkind but posting here in case anyone has a solution or advice. |
Is it possible to combine this with LspKind's config? It looks like cmp's
format
takes a function, which I have usinglspkind.cmp_format
.For example:
The text was updated successfully, but these errors were encountered: