Closed gilbertw1 closed 8 years ago
This is an issue ewith how Java syntax is, not the color scheme. A color scheme simply styles on selectors, which is in change is made by a syntax using regular expression. If there's no selector for parentheses, semicolons, etc. It's not possible to style those.
Ah gotcha. I'd just assumed it was an issue with the theme since most other themes seemed to differentiate these characters properly. I'll do some poking around.....thanks for the quick response!
I will see what I can do. If you find anything interesting keep me updated :-)
After some trial and error, I narrowed the offender down to 'meta.method' in the following block:
<dict>
<key>name</key>
<string>Function, Special Method, Block Level</string>
<key>scope</key>
<string>entity.name.function, meta.function-call, support.function, keyword.other.special-method, meta.method, meta.accessor, meta.block-level, function.name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#61d29d</string>
</dict>
</dict>
Apparently in the java tmLanguage file, meta.method refers to the entire method including everything included in it's entire body (reference here). After removing 'meta.method', the same snippet looks like this:
I'm not sure how this will affect other languages, but I'm not noticing any specific changes for the languages I normally use. If there are detrimental effects they could possibly be worked around by using the specific method elements that need to be styled (a la meta.method.{somethingspecific}).
Thanks again for your quick responses!
Hmm, it seems as if the variables/properties doesn't get coloured, otherwise nice find :-)
Right, and given my experience with Java + various themes in the past is that Java syntax highlighting always comes out a bit boring. Looking at the tmLanguage file for it, it appears that it doesn't export too terribly many scopes. I think the only way to get proper highlighting on variables would require enhancing the tmLanguage file. But at least this change prevents the entirety method body from being colored green.
The boring syntax highlighting support is probably a reflection on the boring nature of the language itself :)
Does this color scheme only support js?
@gilbertw1 You're probably right. Could you make a pull request? This way I have a better log for changes and collaborators :-)
@hiepnhl I have tried to support all languages, including extended syntaxes like JavaScript Babel, etc. But some languages might be broken.
Created pull request: #9
Thanks again for the quick feedback and awesome theme :)
Can you checkout fix-java
and change the Java Methods block on line 143? I have also commented on #9 with an explanation.
The branch also fixes minor syntax coloring for strings.
Just created pull request #10
Made a few more minor changes to match a few more method elements.
Hi,
I really really enjoy using your theme. One minor issue I've bumped into when writing Java using this theme is that miscellaneous separator characters (semicolon, period, parens, braces) appear as green and blend in with much of the other code. I'm not sure if this is intentional, but I'm assuming not since other languages do not style these characters this way.
Here's a quick picture to illustrate what I'm talking about:
This isn't a huge deal, just a very minor annoyance. I've tried mucking around a bit to fix it myself, but haven't had much luck as I'm not very familiar with these theme files.
Thanks!