From a2283cfc9f4aa892349004153ab54dfe8911241c Mon Sep 17 00:00:00 2001 From: Joosep Alviste Date: Thu, 9 Sep 2021 21:44:48 +0300 Subject: [PATCH] Add extra JSX case In JSX, a multi-line call expression should have the normal js `commentstring`. For example: ```jsx
{hello({ foo: 'bar', })}
``` 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 --- lua/ts_context_commentstring/internal.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/ts_context_commentstring/internal.lua b/lua/ts_context_commentstring/internal.lua index 92f59b1..460cf9b 100644 --- a/lua/ts_context_commentstring/internal.lua +++ b/lua/ts_context_commentstring/internal.lua @@ -35,6 +35,8 @@ M.config = { jsx_fragment = '{/* %s */}', jsx_attribute = '// %s', comment = '// %s', + call_expression = '// %s', + statement_block = '// %s', }, javascript = { __default = '// %s', @@ -42,6 +44,8 @@ M.config = { jsx_fragment = '{/* %s */}', jsx_attribute = '// %s', comment = '// %s', + call_expression = '// %s', + statement_block = '// %s', }, }