Change the color of a selected part of a comment


#1

Hi!

I am a user of Hydrogen package, which I love, but there’s something that I haven’t figured out and I’d like to be able to do.

Apparently it is possible to get the cell marker within a comment to get denoted with a different color than other comments. However in my case it all looks grey. Using the stylesheet with css (or less) selectors seems useless given that you cannot select by text. Is there a solution to this?


#2

It looks like how language-todo works (you have a secondary language package that injects itself into certain grammars and looks for specific patterns, such as TODO) and it works by default for me (see below).

Doing some digging, it’s definitely a Hydrogen thing, even though it’s working in my PHP file. As far as I can tell, it should be applied whenever you have Hydrogen active.


#3

Thank you very much! I start to see what the problem is, but I don’t see the solution yet.

Apparently actually the syntax highlighting works perfectly precisely in .cson files! For example here:

But if I work with my python file it doesn’t work at all… I tried to add a ‘fileTypes’: [‘py’] line to pinpoint the types but it doesn’t work either…


#4

TextMate grammars cannot be inserted into Tree sitter grammars (yet?).

Python has a Tree sitter grammar, CSON does not. You can disable them by toggling Settings ➔ Core ➔ Use Tree Sitter Parsers, but TextMate grammars are no longer supported for enhancements and bug fixes when a Tree sitter grammar exists.


#5

Great clarification! Thank you!!!

Btw I found this issue open here: