You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 a JSXChild is expected, but they become valid when wrapped in curly braces {} since then they are treated as JSXChildExpression, 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 {/* */}.
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.
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:
The text was updated successfully, but these errors were encountered: