Before ST4 I had been using the Naomi Javascript syntax for syntax highlighting when writing Javascript. It was mostly okay with the syntax highlighting and handled comments well (when using the CTRL+/ and SHIFT+CTRL+/ commands). Since moving to ST4 I’ve been using the built-in Javascript JSX syntax which handles syntax highlighting flawlessly, but completely falls on its face when it comes to comments. Using CTRL+/ will always wrap a line in a JSX comment, regardless of its scope. In the screenshot below, line 13 is commented properly with the {/* … */}, but comments anywhere else in the file also get the same comment style, like on line 8.
My expectation is that only comments within the actual JSX scope would use the JSX comment style, and anything outside JSX scope would use normal Javascript style comments. This all gets worse when trying to uncomment (because I so often reflexively use the CTRL+/ binding) I get something like this:
Where uncommented comments in JSX blocks leave curly brackets (on line 13 I have commented and uncommented twice). Trying to uncomment outside of JSX scope, like on line 8, there is no uncommenting. Hitting CTRL+/ repeatedly stacks up comments.
Because I’m sure the question will come up, I tried starting up in Safe Mode. Weirdly, the behavior is worse. There is no uncommenting at all, it only stacks up comments and the comments are still not scope appropriate.
I’m hoping someone has a syntax file or something similar that can address this, or, because this is an issue with a shipping syntax, a patch?