Closed ZelCloud closed 1 year ago
//
comments inside of JSX aren't just "wrong", they won't work as comments at all.
//
comments inside of JSX aren't just "wrong", they won't work as comments at all.
Yes, you're right. That was poor wording on my part the //
comment sytnax doesn't work at all for jsx / tsx.
I've noticed another issue. Commenting out an argument should look like
<Foo
// bar={baz}
/>
instead of
<Foo
{/* bar={baz} */}
/>
I also get incorrect indentation of multiple line comments, for example:
function() {
let a = 1;
let b = 2;
let c = 3;
}
when I seleceted the three variables declaration lines and then press M-;, I got:
function() {
// let a = 1;
// let b = 2;
// let c = 3;
}
I'm trying to set it so web-mode uses single line comments for regions of JavaScript and TypeScript code inside a tsx or jsx file, while still using the correct comment syntax for the jsx/tsx html portion.
I've tried setting the web-mode-comment-formats variable, but I'm not getting the desired behavior.
If I set web-mode-comment-formats for JavaScript and typescript like so
Inside my tsx file, I get this behavior:
If I set the jsx tsx comment in web-mode-comments-formats like so
I get this behaviour
What I want ideally is
I'm not sure if this is a bug, or if there's something I'm missing with web-mode-comment-formats. Any help would be appreciated.