MattDMo/Neon-color-scheme

Missing top-level scopes like `entity.name`

ex-nerd opened this issue · 3 comments

This was originally a request to add syntax highlighting for RAML (https://packagecontrol.io/packages/RAML%20Syntax%20Highlighter) but after spending some time looking at both Neon and the RAML extension, along with the Monokai theme (which seems to handle RAML syntax fairly well despite not having any info about it). I think that Neon is just missing some top-level scope declarations. Without adding them all (I can try to enumerate them if you'd like), a few confirmed missing are:

  • entity.name
  • entity.name.tag
  • entity.name.function
  • punctuation.definition
  • punctuation.definition.entry
  • punctuation.separator

Though there are a number of instances of these scope levels being referenced in a more specific scope (e.g. entity.name.function.js), the missing "simpler" scopes result in a lot of missing opportunity for highlighting in file types that descend from higher up (e.g. punctuation.definition.entry.yaml).

Hi Chris,
Thanks for the feedback. I saw the original version of your issue in my email, if you want to add RAML support (I must admit I've never used it before) then feel free to submit a pull request, and I'll check it out.

Regarding the other top-level scopes, I'll look into adding them. I consciously haven't added punctuation.separator, because reasons. I think I also had some issues with entity.name.function in the past, as I believe in at least one language I was looking at, it caused both function definitions and function calls to be the same color. That's why some of the scope definitions in Neon are so long, as there is very little uniformity from one language definition to another, so it needs to be targeted to each one individually. One of the issues I've run into when using pretty broad "top-level" scopes is that sometimes those colors can override more targeted scopes, causing great swathes of code to be all the same color. Monokai is a very simple theme, with just a handful of colors, and is designed to be very general. It's also easily translatable from editor to editor, just because it is so basic. With Neon, I try to go deep and target specific scopes for individual languages, tailoring the colors to make everything look as good as possible (I hope). For example, Clojure (a Lisp derivative that runs on the JVM) is very bracket/brace/parentheses-intensive, so I colored some of them to help the developer visualize where s/he is in the code. For more "open" languages like Python and Ruby, for example, I chose not to color the various brackets because the tend not to be nested very deeply in most circumstances.

So, at any rate, I'll take a look and see what I can improve. If you have specific pieces of code in your favorite language(s) that you'd like me to enhance, please post them here so I have examples to work off of.

MattDMo

The RAML language uses lower-level scopes (e.g. entity.name.function.yaml) but I mentioned the top-level ones because that seemed to be the standard/best practice from the official themes like Monokai.

Interesting about the overrides (which sounds like a bug in Sublime that someone should report), but that does sound like a pretty good reason for avoiding them.

Anyway, feel free to do what you want with this issue. I'll open a pull request once I have some good chances for RAML (and likely a second one for OpenSCAD, once I have time to update the plugin I've decided to start updating/maintaining).

Closing in favor of #19.