-
Notifications
You must be signed in to change notification settings - Fork 64
[Question] 'support.type.class' scope design decision #37
Comments
Here's what I mean by additional scopes.
In this way, a comment containing a task tag would have the following structure: // TODO: Highlight this line.
^^^^-------------------------------------- 'storage.type.class.todo' (for backward compatibility)
^^^^---------------------------------- 'entity.other.task-tag.todo' (for more precise and simple selectors)
^^^^^^^^^^^^^^^^^^^^^^^^^^-------- 'meta.toc-list.task-tag'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---- 'comment.line.double-slash' Also users could choose to style whole lines as well. Here's an example using C Improved: Please let me know what you think, and whether you are interested in such changes or not. |
Choosing the right scope is an open issue though. On the one hand, it could be
On the other hand, a task tag is more like a keyword. But:
And that other group could really be The proper order of the old and new scopes is also an open question:
One more thing that I think could be addressed more or less easily is classifying task tags into categories by priority:
This would let color schemes style task tags in a generic way (e.g. red/yellow/green highlighting like shown on the screenshot above). |
Sorry for that long mindflow. Let me summarize it as a survey:
Please feel free to check the marks above (contributors have editing rights). Comments are appreciated. |
This adds compatibility with the 'language-todo' Atom package [1] and the corresponding TextMate bundle [2]. See also: atom/language-todo#37 ("[Question] 'support.type.class' scope design decision") [1]: https://github.com/atom/language-todo [2]: https://github.com/textmate/todo.tmbundle
This adds compatibility with the 'language-todo' Atom package [1] and the corresponding TextMate bundle [2]. See also: atom/language-todo#37 ("[Question] 'support.type.class' scope design decision") [1]: https://github.com/atom/language-todo [2]: https://github.com/textmate/todo.tmbundle
Having developed ~15 language grammars myself, I long ago came to the conclusion that semantics are secondary to clarity of highlighting. In short, the semantics of scope-choices aren't applicable to all grammar contexts, especially injections. |
Hi,
I'm a developer of the Sublime C Improved package and I'm thinking about to port it also to Atom and VS Code. Recently I was asked to add an ad-hoc highlighting of TODO, FIXME, etc. task tags within the syntax definition, since ST doesn't support
injectionSelector
, which powers thelanguage-todo
package and its TM ancestor. I aim to keep the syntax compatible with existing solutions as much as possible, and that's how I came across this package.However, I'm confused about the
support.type.class
choice for the task tags. The thing is, I'd like to make a PR for a color scheme customizing highlighting of TODO, FIXME, etc. task tags, and I'm stuck for specifying the right scope selector for that.Obviously I can't just match
support.type.class
because it also covers valid source tokens likeclass
orstruct
.Should it be
(comment | text.plain) support.type.class
then? And what if the list of injection scopes gets expanded like proposed in #36?Basically, what is the rationale behind choosing this particular scope for task tags? Am I missing something or it is likely just a legacy scope retained for backward compatibility? If so, what's about attaching additional more specific scopes for task tags?
The text was updated successfully, but these errors were encountered: