mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 23:40:04 -04:00
Update Capnp (#4713)
* feat(capnp): update queries from upstream changes * test: add tests for capnp * fix indent queries * ci: fix capnp indent tests --------- Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
This commit is contained in:
parent
e8081bb162
commit
12453e0e3d
5 changed files with 1787 additions and 52 deletions
30
tests/indent/capnp_spec.lua
Normal file
30
tests/indent/capnp_spec.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
local Runner = require("tests.indent.common").Runner
|
||||
|
||||
local run = Runner:new(it, "tests/indent/capnp", {
|
||||
tabstop = 2,
|
||||
shiftwidth = 2,
|
||||
expandtab = true,
|
||||
})
|
||||
|
||||
describe("indent Cap'n Proto:", function()
|
||||
describe("whole file:", function()
|
||||
run:whole_file(".", {
|
||||
expected_failures = {},
|
||||
})
|
||||
end)
|
||||
|
||||
describe("new line:", function()
|
||||
run:new_line("test.capnp", { on_line = 31, text = "foo @0;", indent = 2 })
|
||||
run:new_line("test.capnp", { on_line = 96, text = "boolField = true,", indent = 4 })
|
||||
run:new_line("test.capnp", { on_line = 340, text = "grault @7 :UInt64;", indent = 8 })
|
||||
run:new_line("test.capnp", {
|
||||
on_line = 573,
|
||||
text = "call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));",
|
||||
indent = 4,
|
||||
})
|
||||
run:new_line("test.capnp", { on_line = 617, text = "foo @0 :Foo;", indent = 4 })
|
||||
run:new_line("test.capnp", { on_line = 654, text = "foo = (int16Field = 123),", indent = 4 })
|
||||
run:new_line("test.capnp", { on_line = 695, text = 'textField = "nested",', indent = 6 })
|
||||
run:new_line("test.capnp", { on_line = 970, text = "testTailCaller @4;", indent = 4 })
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue