We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6537549 commit ed18b8aCopy full SHA for ed18b8a
README.md
@@ -370,6 +370,7 @@ local ft = require('Comment.ft')
370
ft.set('javascript', {'//%s', '/*%s*/'})
371
372
-- set line, block and override commentstring
373
+-- for particular treesitter nodes
374
ft.set("javascript", {
375
"// %s",
376
"/*%s*/",
@@ -455,17 +456,6 @@ There are multiple ways to contribute reporting/fixing bugs, feature requests. Y
455
456
- Live upto the expectation of `tcomment`
457
- Basic INSERT mode mappings
458
- Doc comment i.e `/**%s*/` (js), `///%s` (rust)
-
459
-- Inbuilt context commentstring using treesitter
460
461
-```lua
462
-{
463
- pre_hook = function()
464
- return require('Comment.ts').commentstring()
465
- end
466
-}
467
-```
468
469
- Header comment
470
471
```lua
lua/Comment/comment.lua
@@ -15,7 +15,6 @@ function C.comment()
15
local pattern = U.get_pattern(C.config.ignore)
16
if not U.ignore(line, pattern) then
17
local ctx = Ctx:new({
18
- lang = U.get_lang(),
19
cmode = U.cmode.comment,
20
cmotion = U.cmotion.line,
21
ctype = U.ctype.line,
lua/Comment/ctx.lua
@@ -18,7 +18,6 @@ function Ctx:new(opts)
opts.lang = ts.get_lang()
opts.contained = ts.get_containing_node()
- opts.other = true
22
23
return setmetatable(opts, self)
24
end
lua/Comment/ft.lua
@@ -28,8 +28,28 @@ local L = {
28
html = { M.html_b, M.html_b },
29
idris = { M.dash, M.haskell_b },
30
java = { M.cxx_l, M.cxx_b },
31
- javascript = { M.cxx_l, M.cxx_b },
32
- javascriptreact = { M.cxx_l, M.cxx_b },
+ javascript = {
+ M.cxx_l,
33
+ M.cxx_b,
34
+
35
+ jsx_fragment = { '{/* %s */}' },
36
+ jsx_element = { '{/* %s */}' },
37
+ jsx_attribute = { '// %s' },
38
+ jsx_expression = { '// %s', '/*%s*/' },
39
+ call_expression = { '// %s', '/*%s*/' },
40
+ statement_block = { '// %s' },
41
+ },
42
+ javascriptreact = {
43
44
45
46
47
48
49
50
51
52
53
julia = { M.hash, '#=%s=#' },
54
lidris = { M.dash, M.haskell_b },
55
lua = { M.dash, '--[[%s--]]' },
0 commit comments