nvim-treesitter/tests/indent/nickel_spec.lua
Zheng PiaoDan dba8c8e781
fix(nickel): wrong indent on line after top level comment (#4792)
* fix(nickel): wrong indent on line after top level comment

Previous incorrect indentation on line after top level comment:

```
# no indent after this comment
  {
  another = 1
}
```

Expected result:

```
# no indent after this comment
{
  another = 1
}
````
2023-05-13 15:03:05 +09:00

25 lines
1,000 B
Lua

local Runner = require("tests.indent.common").Runner
local run = Runner:new(it, "tests/indent/nickel", {
shiftwidth = 2,
expandtab = true,
})
describe("indent Nickel:", function()
describe("whole file:", function()
run:whole_file(".", {
expected_failures = {},
})
end)
describe("new line:", function()
run:new_line("indent-newline.ncl", { on_line = 1, text = "stmt", indent = 2 })
run:new_line("indent-newline.ncl", { on_line = 2, text = "stmt", indent = 2 })
run:new_line("indent-newline.ncl", { on_line = 3, text = "stmt", indent = 4 })
run:new_line("indent-newline.ncl", { on_line = 4, text = "]", indent = 2 })
run:new_line("indent-newline.ncl", { on_line = 5, text = "stmt", indent = 2 })
run:new_line("indent-newline.ncl", { on_line = 6, text = "stmt", indent = 4 })
run:new_line("indent-newline.ncl", { on_line = 7, text = "}", indent = 2 })
run:new_line("indent-newline.ncl", { on_line = 11, text = "stmt", indent = 0 })
end)
end)