MattDMo / Neon-color-scheme

A colorful bright-on-black color scheme for Sublime Text. Its aim is to make as many languages as possible look as good as possible. Includes extended support for Python, Ruby, Clojure, JavaScript/JSON, C/C++, diff, HTML/XML, Markdown, PHP, CSS/SCSS/SASS, GitGutter, Find In Files, PackageDev, Regex, SublimeLinter, and much more.
https://github.com/MattDMo/Neon-color-scheme
MIT License
174 stars 36 forks source link

Generalize scopes for task tags (TODO, FIXME, etc.) #26

Closed abusalimov closed 8 years ago

abusalimov commented 8 years ago

Hi,

I'm a developer of the C Improved package mentioned earlier in #24, and I also use your Python Improved package (thank you, BTW :+1:).

This PR modifies the rules responsible for highlighting TODO task tags to apply to meta.toc-list.task-tag and entity.other.task-tag scopes.

First of all, comment.line.note does not fit very well, because at least there is a comment.block scope for languages that support /* block */ comments. And a block comment can have both normal and task tag lines, and only the latter should be highlighted. That is, the highlighted part does not necessarily span the whole comment, and we need to separate a scope for that part from the comment itself.

Secondly, a task tag scoped as comment.line.note.notation is not actually a comment too, but rather some self-sustained entity within the outer comment.

According to the TextMate language grammar naming conventions:

In this way, a comment containing a task tag is expected to have the following structure:

# TODO: Highlight this line.
  ^^^^---------------------------------- 'entity.other.task-tag.todo'
  ^^^^^^^^^^^^^^^^^^^^^^^^^^-------- 'meta.toc-list.task-tag.todo'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^---- 'comment.line.number-sign'

Here is how it looks like when using abusalimov/SublimeCImproved#30:

sublime-c-improved-toc-list-specialized

Please note however, that this change currently breaks the highlighting of task tags in Python Improved. If you agree with this change, I could try to make a PR for Python Improved as well, if you want. FWIW, here's how I've implemented it: abusalimov/SublimeCImproved@0dcf851c0931c0af255cc010622b0d21022891fc

Also, I'm not a designer, so the proposed colors for new scopes may need to be revised.

Please let me know, what do you think!

/cc @xtotdam

MattDMo commented 8 years ago

Thanks for the PR, I'll take a look at it.

MattDMo commented 8 years ago

@abusalimov This looks really interesting. Feel free to put together a PR for PythonImproved as well - I'd love to see how it can be implemented there. As far as keeping the current behavior for PI, why not just create separate dicts for meta.toc-list.task-tag and entity.other.task-tag? I don't think we need to replace them at this point.

abusalimov commented 8 years ago

As far as keeping the current behavior for PI, why not just create separate dicts for meta.toc-list.task-tag and entity.other.task-tag? I don't think we need to replace them at this point.

Do you mean restoring comment.line.note[.notation] just for backward compatibility?

MattDMo commented 8 years ago

exactly

MattDMo commented 8 years ago

Sorry for taking such a long time to take care of this - I've been using it in my personal copy for a while, and I really like it. I've also added a number of other scopes using your technique of having a brightly-colored foreground over a dimly-colored background just by decreasing the brightness slider.

At any rate, in case you're tracking things, this was just entered into master with 278c3a1, and I'll be pushing a new release out soon, hopefully tonight or tomorrow night.

abusalimov commented 8 years ago

Better late than never! I've noticed the commit, thank you :+1: