mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(indent): ecma - class method indentation
This commit is contained in:
parent
1eaf0150c2
commit
20168d8e20
3 changed files with 34 additions and 1 deletions
|
|
@ -5,7 +5,6 @@
|
|||
(class_body)
|
||||
(export_clause)
|
||||
(formal_parameters)
|
||||
(method_definition)
|
||||
(named_imports)
|
||||
(object)
|
||||
(object_pattern)
|
||||
|
|
|
|||
20
tests/indent/ecma/class.js
Normal file
20
tests/indent/ecma/class.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class IndentTest {
|
||||
async isEqual(paramOne, paramTwo) {
|
||||
if (paramOne === paramTwo) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
async isNotEqual(
|
||||
paramOne,
|
||||
paramTwo,
|
||||
) {
|
||||
if (paramOne !== paramTwo) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
@ -36,6 +36,20 @@ describe("indent JavaScript:", function()
|
|||
run:new_line("ecma/callback.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4])
|
||||
end
|
||||
|
||||
for _, info in
|
||||
ipairs {
|
||||
{ 1, 2 },
|
||||
{ 2, 4 },
|
||||
{ 3, 6 },
|
||||
{ 5, 4 },
|
||||
{ 8, 2 },
|
||||
{ 11, 4 },
|
||||
{ 13, 4 },
|
||||
}
|
||||
do
|
||||
run:new_line("ecma/class.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4])
|
||||
end
|
||||
|
||||
for _, info in
|
||||
ipairs {
|
||||
{ 2, 2 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue