Skip to content

Commit a2283cf

Browse files
committed
Add extra JSX case
In JSX, a multi-line call expression should have the normal js `commentstring`. For example: ```jsx <div> {hello({ foo: 'bar', })} </div> ``` Commenting the line with `foo: 'bar',` shouldn't use the JSX comment style. There are other similar cases that might fail though, for example, a multi-line array or string, but those are even rarer cases. Related to #22
1 parent 72a3f45 commit a2283cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/ts_context_commentstring/internal.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ M.config = {
3535
jsx_fragment = '{/* %s */}',
3636
jsx_attribute = '// %s',
3737
comment = '// %s',
38+
call_expression = '// %s',
39+
statement_block = '// %s',
3840
},
3941
javascript = {
4042
__default = '// %s',
4143
jsx_element = '{/* %s */}',
4244
jsx_fragment = '{/* %s */}',
4345
jsx_attribute = '// %s',
4446
comment = '// %s',
47+
call_expression = '// %s',
48+
statement_block = '// %s',
4549
},
4650
}
4751

0 commit comments

Comments
 (0)