mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 01:40:02 -04:00
fix(dart): add @indent_end to } (#4167)
* fix dart indentation after } * add some simple test case
This commit is contained in:
parent
5c511dd124
commit
68ab44277c
3 changed files with 28 additions and 0 deletions
|
|
@ -21,6 +21,10 @@
|
||||||
"]"
|
"]"
|
||||||
] @branch
|
] @branch
|
||||||
|
|
||||||
|
[
|
||||||
|
"}"
|
||||||
|
] @indent_end
|
||||||
|
|
||||||
; this one is for dedenting the else block
|
; this one is for dedenting the else block
|
||||||
(if_statement (block) @branch)
|
(if_statement (block) @branch)
|
||||||
|
|
||||||
|
|
|
||||||
4
tests/indent/dart/class.dart
Normal file
4
tests/indent/dart/class.dart
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
void main() {
|
||||||
|
}
|
||||||
|
class Test {
|
||||||
|
}
|
||||||
20
tests/indent/dart_spec.lua
Normal file
20
tests/indent/dart_spec.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
local Runner = require("tests.indent.common").Runner
|
||||||
|
|
||||||
|
local run = Runner:new(it, "tests/indent/dart", {
|
||||||
|
tabstop = 4,
|
||||||
|
shiftwidth = 2,
|
||||||
|
softtabstop = 0,
|
||||||
|
expandtab = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("indent Lua:", function()
|
||||||
|
describe("whole file:", function()
|
||||||
|
run:whole_file(".", {
|
||||||
|
expected_failures = {},
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
describe("new line:", function()
|
||||||
|
run:new_line("class.dart", { on_line = 2, text = "var x;", indent = 0 })
|
||||||
|
end)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue