facelessuser / ColorHelper

Sublime plugin that provides helpful color previews and tooltips
https://facelessuser.github.io/ColorHelper/
MIT License
255 stars 30 forks source link

Add support for variables in files such as SASS, CSS, etc. #142

Closed facelessuser closed 3 years ago

facelessuser commented 4 years ago

This is a general feature request for variables in things like CSS and SASS, etc.

There is a strong chance that this will never come to fruition. There is a desire to make this faster and this kind of feature may cause a lot of lag in the interface. There may be ways to go about this to make it work good, but the question is whether there is motivation to overhaul the code in this form.

Ref #69 and #101

@gir-bot add T: feature, P: maybe @gir-bot lgtm

5HT2 commented 4 years ago

Came to the repo to ask exactly this. Is there any change on this?

facelessuser commented 4 years ago

My current view on this hasn't changed. While I haven't given this a hard no, I still think this is going to be unlikely. In general, I am pretty vocal when I decide something, so I will update this issue if my view changes and/or I have substantial work for the feature request.

5HT2 commented 4 years ago

Alright. I'd like to fork this and add an option myself, but I looked at the codebase and I'm not that good with python. Is there like one singular check if the file type is css or how does it work?

facelessuser commented 4 years ago

Well...um...there is some complexity here. In managing the phantoms, scanning, working in different syntax files, etc.

Unfortunately, it would take me a bit to do a write up on this. I'd look over the docs and see the configurations on setting up different syntaxes. Then look in the code for those areas.

The way it works now, uses preset patterns for different color types. You enable the color types you want for different syntaxes. In the future, some of this is going to get reworked, as in retrospect, I feel it could have been done much better, but I digress. This was kind of a proof of concept/me screwing around project that turned into something many people latched onto.

Anyways, you will have to greatly augment things to get what you are looking for, but if you have more pointed questions about something very specific in the code, I am happy to answer those questions. It is a bit difficult to answer very broad questions as I may end up writing an essay. So it would be when I have time.

5HT2 commented 4 years ago

All good. I was hoping it would be something quick I could do, but I'm sort of pressed on time with it. I'll get to it another day I guess, thanks!

facelessuser commented 4 years ago

No worries, if it was easy, I would have been easier to persuade in adding this feature. It's the main reason I'm on the fence about it. The feature is kind of larger than my current motivation. And possibly in opposition to the direction I'll be heading with future refactoring.

facelessuser commented 3 years ago

This is really a job for an LSP server. We'd have to spawn our own separate process and scan the whole project as variables can be in other files entirely. This is beyond the scope of what I want to pursue.

ColorHelper is being rewritten with a new color library and should support more color spaces and such. Users, if they desire, could provide there own color class and override specific color spaces to recognize colors in any format they want, and output them as well in custom formats.

With all of that said, I do not intend to provide a project scanner to gather variables in different formats for different languages. This is more work than I am currently willing to take on. I think I can finally close this issue.

5HT2 commented 3 years ago

Sounds good, thank you!