-
Notifications
You must be signed in to change notification settings - Fork 201
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
style(tailwind): use block vs. icon for Color items #544
Conversation
Looks good! Although I don't think we should replace the icon for all |
Agree, let me correct it. |
3f77374
to
81cf099
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
81cf099
to
289d7b2
Compare
Alright @Saghen, think it's ready for review now. I took the opportunity to clean up some of the code a bit, hope it's OK. |
@Saghen LMK if you'd like me to roll back some of the unnecessary changes, or whether you'd prefer I go in a different direction. Lay it on me, I won't be offended ;) |
Thanks! |
@Saghen, @minusfive |
I'd originally made it configurable through the Kinds array, but that was before I learned Kinds are actually defined at the protocol level https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/, which I believe is one of the reasons @Saghen refactored my original. Wouldn't be too hard to add a config option I'd think. Unfortunately I'll be tied up for the next couple of weeks, but if I find the time I'll give it a shot. Or feel free to submit your own PR! |
@nmfirdausw I wanted the same and I got it working with the following: opts = {
completion = {
menu = {
draw = {
components = {
kind_icon = {
text = function(ctx)
if require("blink.cmp.completion.windows.render.tailwind").get_hex_color(ctx.item) then
return ""
end
return ctx.kind_icon .. ctx.icon_gap
end,
},
},
},
},
},
} |
I feel like this is the best option, tbh. Not sure it's worth polluting the config table with a single orphan icon outside of the kinds array. Component overrides are very powerful and let you do whatever you want. |
Use block characters instead of an icon for the
Color
item "kind" to make swatches more usable.Old
New