feat: improve indent module

get_node_at_line should return appropriate child if available
This commit is contained in:
Munif Tanjim 2022-01-17 04:44:01 +06:00 committed by Christian Clason
parent f048886f82
commit baf94219aa
5 changed files with 38 additions and 11 deletions

View file

@ -28,7 +28,7 @@ describe("indent Lua:", function()
run:new_line("table.lua", { on_line = 1, text = "b = 0,", indent = 2 })
run:new_line("table.lua", { on_line = 5, text = "4,", indent = 4 })
run:new_line("table.lua", { on_line = 7, text = "4,", indent = 4 })
run:new_line("loop.lua", { on_line = 4, text = "x = x + 1", indent = 2 }, "expected failure", XFAIL)
run:new_line("loop.lua", { on_line = 4, text = "x = x + 1", indent = 2 })
run:new_line("cond.lua", { on_line = 5, text = "x = x + 1", indent = 2 })
run:new_line("cond.lua", { on_line = 7, text = "x = x + 1", indent = 2 })
run:new_line("cond.lua", { on_line = 8, text = "x = x + 1", indent = 4 })