Skip to content
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

feat(pack): show custom tailwindcss colors in cmp menu #197

Merged
merged 2 commits into from
May 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lua/astrocommunity/pack/tailwindcss/tailwindcss.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ return {
{
"hrsh7th/nvim-cmp",
dependencies = {
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
{ "js-everts/cmp-tailwind-colors", config = true },
},
opts = function(_, opts)
local format_kinds = opts.formatting.format
opts.formatting.format = function(entry, item)
format_kinds(entry, item)
return require("tailwindcss-colorizer-cmp").formatter(entry, item)
if item.kind == "Color" then
item = require("cmp-tailwind-colors").format(entry, item)
return item
end
return format_kinds(entry, item)
end
end,
},
Expand Down