-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Colors for items in the completion menu #12299
Colors for items in the completion menu #12299
Conversation
CompletionItemKind::COLOR
CompletionItemKind::COLOR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my two cents 👀 You can decline them. But nice feature!
12eab06
to
52ce26c
Compare
Not for this PR, but a good follow up would be to add the square before any colour string in a file, not just on LSP completions. |
This looks like it will conflict with #12151. It would be logical to combine the two if possible |
It's not possible to think about all 272 PRs and whether this one will conflict with any of them depending on which PR gets merged first, the other has to resolve merge conflicts |
I'm actually working on that https://github.com/NikitaRevenco/helix/tree/textDocument/documentColor :) |
Just a thought, is the word 'color' before every color maybe a little redundant? The only scenario in which I can see this being useful is one in which the color to be rendered happens to match the background. An alternative use for this space might be to show the hex/RGB/HSL representation of the color? |
I think it's fine to keep it as is, if we have a bunch of hsl/hex/rgb colors it will get messy + the only information we actually do have is hex colors. We would have to manually convert them to hsl/rgb if we needed to. Then, which should be pick - rgb or hsl?"Should it be a config option? + You can already see what the color is from the completion menu. It introduces so much unnecessary complexity and not worth it at all imo |
I agree that adding a RGB or HSL option is probably not worth the effort. My main point was that annotating each color as 'color' is redundant. |
it's for accessibility, since not everyone can recognize differences between colors |
Nice stuff! Can be easily merged with #12151 |
This PR adds little colored boxes to completion items if its a color
It works on any
Color
completion item, so it works with CSS, tailwindcss, any other language server which provides "colors".