Skip to content

Conversation

@Akianonymus
Copy link
Contributor

easy to identify

in tailwindcss, color properties show Color and rest are Constant

update items.lua

easy to identify

in tailwindcss, color properties show Color and rest are Constant
helpful for classes which have multiple lines
@Akianonymus Akianonymus changed the title feat: Show Item Kind in completion menu feat: Show Item Kind in completion menu | Show full expanded snippet in documentation window Feb 24, 2023
@Akianonymus
Copy link
Contributor Author

image

image

@jcha0713
Copy link
Owner

Hey, thank you so much for the PR. I have not checked everything yet, but it looks awesome! I just need a little more time to test it out.

@Akianonymus
Copy link
Contributor Author

Take your time. Thank you for the plugin, such a life saver.

@jcha0713
Copy link
Owner

jcha0713 commented Mar 2, 2023

Hi! Thank you for your patience. I reviewed your PR last night and here's a few questions that I would like to ask.

  1. I noticed using "color:" instead of "color" produces more accurate results. Can you explain why you chose to omit the colon for "color"?

  2. This is what I see before applying your PR:

Screenshot 2023-03-02 at 16 49 40

And this is after applying changes you suggested:
Screenshot 2023-03-02 at 16 48 53

I tried to remove the duplicates but have not found a way to do so. Do you have any idea why this might be occurring?

  1. It appears that the syntax highlighting within the documentation window only works when the text is wrapped with a pair of curly brackets. Based on my understanding, this is the correct behavior, as this is also how you enable syntax highlighting for CSS in a markdown file. (please correct me if I'm wrong). So I'm looking for ways to wrap the documentation text with { } like this:

(ignore the top part)
Screenshot 2023-03-02 at 17 40 51

I noticed you managed to get this working without wrapping it with { } and I'm curious how that was possible.

@jcha0713 jcha0713 merged commit 91530f8 into jcha0713:main Mar 4, 2023
@jcha0713
Copy link
Owner

jcha0713 commented Mar 4, 2023

Hey :) it got merged! Thank you for your effort.

I used "color:" for better results but let me know if you think the one without the colon is better.
I solved the second problem by setting completion_item.detail to nil.

@Akianonymus
Copy link
Contributor Author

Thank you for merging.

I probably did that in case the insert text is color : rgb(1,1,1). ( Yes, this logic makes sense for fill and stroke too )

Actually a better solution would be to use color%s*: ( and so on for fill and stroke ), basically spaces can be there before : for a valid color.
Anyway, this is all meaning less if in items.lua css is properly inserted.

About the documentation thing, it's showing some syntax highlight because i use the noice.nvim markdown renderer for cmp. Although technically, it shouldn't work as without the braces it's not valid css code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants