Open adrian5 opened 7 years ago
In case I wasn't clear enough, the following screenshot shows a mis-colored element:
I get cyan lifetimes regardless of the syntax theme used, and suspect it to be some fallback or ui-theme defined color. If lifetimes took on a color of the theme's palette, that would be nice. If other users do not experience this problem, then please speak up.
Lifetimes are recognized into scope storage.modifier.lifetime.rust
(whole lifetime including apostrophe) and entity.name.lifetime.rust
(only the lifetime's name). This allows syntax themes or your custom css to apply color specifically to lifetime labels. However, I don't know of any syntax theme that does so, so in most cases it will fall back to the more generic storage modifier or entity name color of the syntax scheme. There doesn't seem to be wrong tokenization from the grammar side here.
I looked into this again, since no theme implements it and found myself unable to override Atom's styling. It looks like there's a persistent definition that takes precedence over anything themes bring in, probably because the selector is more elaborate:
My attempted override is the yellow color
style. I think this conflict is what causes every theme to fail applying its own style. Could you give your opinion on this? Is it something that would need to be fixed in the Atom editor repo?
Ok, someone pointed me to the reason. You're overriding lifetimes with your own stylesheet in the language package. This creates cyan lifetimes for every theme. Would have been helpful if you had mentioned that in your response. I think you should dial down the default mix from 70%
to something betwenn 20%
to 10%
, since cyan doesn't mesh well with most themes.
Darn, I almost forget about that by myself! Yes, actually, I thought this would be a short-living workaround since there shouldn't be any styles in this package at all. We should find a more suitable permanent solution for this.
p.s. Mixing with a color other than @syntax-text-color
might be another option. Most themes define it as a low-saturation color which – mixed with cyan – results in saturated cyan. But yeah, try ~20%
and see how you like it; I think it's an acceptable quick fix.
I don't know if this is fixable, but lifetime labels like
'static
appear to end up in an element category that isn't targeted by syntax themes.Below the information Atom gives me on such elements (not sure if that helps):