Open cotneit opened 2 months ago
I don't want to create a new issue, just gonna leave it here maybe?
Comments are incorrectly inferred in Vue.js (.vue) files as well
It's really annoying that I can't properly comment big chunks of html in jsx files
It's really annoying that I can't properly comment big chunks of html in jsx files
They're working on it, here:
@Nikita0x oh, I hope so. Because there are less and less commits with any changes
Comments in JSX are a bit special, and it would be nice if Helix could handle them a bit better than it does now when it comes to commenting and uncommenting.
JS comments (
//
and/* */
) are not valid where aJSXChild
is expected, but they become valid when wrapped in curly braces{}
since then they are treated asJSXChildExpression
, and it being optional the entire thing can be a comment, resulting in{/* */}
essentially being a block comment token pair for this particular case.In every other case inside a JSX file regular JS comments are valid and should be preferred over
{/* */}
.For example, every comment here is valid:
Looks like VS Code implements this by injecting a special language:
embeddedLanguages
)I imagine this could be replicated in Helix, but currently injection comment tokens are ignored, so I would consider this to be blocked:
That said, I don't think these issues being resolved will result in JSX/TSX comments working properly without additional efforts, hence this issue. I could be wrong.
Prior issues on this topic: