Closed naveg closed 7 years ago
Thanks for the report, @Naveg, as well as the detailed examples and counterexamples! I am able to repro this issue.
Unfortunately, I don't see a great way to fix this. The core issue here is as follows:
jsClassBlock
syntax region contains a pretty narrow subset of things, none of which transparently contains jsxRegion
.jsArrowFunction
syntax element can impose a special-case match on the next element, but it only looks for jsFunctionBraces
, which you're omitting explicitly in your example.jsClassValue
syntax element can contain arbitrary expressions (including JSX), but is explicitly ended by a newline character.Together, this actually means that you could replace your JSX element with pretty much anything and the highlighting would be broken, e.g.:
The tl;dr is that this seems like a bug with pangloss/vim-javascript. Feel free to file a bug report over there, and if their fix doesn't address this specific case, let me know.
Closing out because it's not readily actionable from vim-jsx's end. (Feel free to reopen if things change upstream.)
My coworkers are always telling me to remove useless parens, but they aren't useless to me! ;)
Here's a modified plugin section of my vimrc. The bug reproduces with a vimrc consisting of this snippet only.