mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-09 23:10:11 -04:00
feat(nix): indentation queries
This commit is contained in:
parent
ee29084ce6
commit
55a13862cd
4 changed files with 379 additions and 0 deletions
40
tests/indent/nix_spec.lua
Normal file
40
tests/indent/nix_spec.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
local Runner = require("tests.indent.common").Runner
|
||||
|
||||
local runner = Runner:new(it, "tests/indent/nix", {
|
||||
tabstop = 2,
|
||||
shiftwidth = 2,
|
||||
softtabstop = 2,
|
||||
expandtab = true,
|
||||
})
|
||||
|
||||
describe("indent Nix:", function()
|
||||
describe("whole file:", function()
|
||||
runner:whole_file(".", {
|
||||
expected_failures = {},
|
||||
})
|
||||
end)
|
||||
|
||||
describe("new line:", function()
|
||||
for _, info in ipairs {
|
||||
{ 14, 2 },
|
||||
{ 16, 2 },
|
||||
{ 48, 4 },
|
||||
{ 112, 6 },
|
||||
} do
|
||||
runner:new_line("general.nix", { on_line = info[1], text = "x = 1;", indent = info[2] })
|
||||
end
|
||||
|
||||
for _, info in ipairs {
|
||||
{ 115, 6 },
|
||||
{ 113, 10 },
|
||||
{ 6, 4 },
|
||||
{ 12, 2 },
|
||||
{ 16, 6 },
|
||||
{ 35, 6 },
|
||||
{ 23, 2 },
|
||||
{ 21, 6 },
|
||||
} do
|
||||
runner:new_line("conds.nix", { on_line = info[1], text = "x = 1;", indent = info[2] })
|
||||
end
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue