facelessuser / ColorHelper

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

add xml plist color rule #233

Closed alvarolm closed 1 year ago

alvarolm commented 1 year ago

https://github.com/facelessuser/ColorHelper/issues/232

facelessuser commented 1 year ago

@alvarolm what package did you install to get XML (PLIST). I think it may be useful to know in order to come up with the best solution. I may be able to move this forward if I can reproduce it locally.

alvarolm commented 1 year ago

@alvarolm what package did you install to get XML (PLIST). I think it may be useful to know in order to come up with the best solution. I may be able to move this forward if I can reproduce it locally.

just tried to customize the color scheme ("UI: customize color scheme") form the color scheme "base16 ocean" in the theme space gray maintained by sublime hq https://github.com/SublimeText/Spacegray there might be some out of date corner cases since the last commit to the theme was in 2019

facelessuser commented 1 year ago

It's not the color scheme I'm interested in as much as the XML (Plist) syntax. By default Sublime just ships with XML, so I'm not sure where the XML (Plist) syntax is coming from for you.

alvarolm commented 1 year ago

It's not the color scheme I'm interested in as much as the XML (Plist) syntax. By default Sublime just ships with XML, so I'm not sure where the XML (Plist) syntax is coming from for you.

i think maybe st4 or the latest releases takes in to consideration the xml subscope https://github.com/SublimeText/Spacegray/blob/8d4a59de254a27cc7c588c07a6a86662c0cf48d8/base16-ocean.dark.tmTheme#L3

scope

facelessuser commented 1 year ago

Nope, I have an isolated 4126 that matches what you reported, and I have the very latest dev branch; none of which have XML (PList).

Can you list your installed plugins maybe?

facelessuser commented 1 year ago

@alvarolm can you run this in the console with the Plist view focused?

>>> sublime.active_window().active_view().syntax()
Syntax('Packages/XML/XML.sublime-syntax', 'XML', False, 'text.xml')

That should give me an idea of the package name and such.

alvarolm commented 1 year ago

@alvarolm can you run this in the console with the Plist view focused?

>>> sublime.active_window().active_view().syntax()
Syntax('Packages/XML/XML.sublime-syntax', 'XML', False, 'text.xml')

That should give me an idea of the package name and such.

sublime.active_window().active_view().syntax()
Syntax('Packages/zzz A File Icon zzz/aliases/XML (PList).sublime-syntax', 'XML (PList)', True, 'text.plist')
facelessuser commented 1 year ago

Hmm, that is not as helpful as I hoped as it obscured the actual package name with the "A File Icon" alias 😞.

Well, it seems like we could extend the existing rules with text.plist, but I'd like to get the full proper scope by identifying the actual package being used 🤔.

It seems you've installed some kind of package that provides a Plist syntax, I just don't know what it is yet....

facelessuser commented 1 year ago

Before we can move forward, we really need to identify the syntax package you are using. While the scope seems to be under text.plist I am almost certain the rest of the scoping below is incorrect:

"text.xml -meta.tag.xml -comment -string, string.unquoted.cdata.xml"

I cannot be certain, so this will require that we can figure out where this syntax is coming from and what the actual scoping is.

alvarolm commented 1 year ago

sorry but I have been busy with other things. If there is a command or anything you would like to execute in order to debug please tell me, for the mean time the proposed pull request has solved the issue for me.

facelessuser commented 1 year ago

Unfortunately, without knowing what the actual syntax file is, and properly extracting and configuring the scopes, I cannot merge this. I can almost guarantee that that only text.plist -string -comment is correct in this entire rule:

            "scanning": [
                "text.plist -meta.tag.xml -comment -string, string.unquoted.cdata.xml"
            ]

I'm not sure where the syntax you are using is coming from, but I have confirmed it is not coming from the default Sublime Text. Whether this is a syntax provided via the User folder or some other plugin, I cannot say.

As things stand now, I cannot merge a likely wrong rule, even if it appears to fix the issue for you. If we are going to merge this, we need to do it correctly. If the syntax plugin that is being used cannot be identified, I would keep this rule as a user rule in your personal settings instead until at some future time we can identify the proper syntax and scoping, allowing us to construct a proper rule.

facelessuser commented 1 year ago

Unfortunately, as it has yet to be determined what syntax file was used, or where it came from, I am considering this issue as stale and will be closing it.

I am more than happy to reconsider at any time if we can properly identify where this is coming from so that we can properly acquire the correct scopes.

The good news is that you should be able to continue to use your workaround in your user settings to correct this for your particular issue.