mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 12:06:55 -04:00
Added fix for incorrect Java indentation after a closing "}" in a method declaration
Added tests for Java indentation, including one for issue 2571
This commit is contained in:
parent
fb7a56548b
commit
b425a9c813
4 changed files with 36 additions and 0 deletions
23
tests/indent/java_spec.lua
Normal file
23
tests/indent/java_spec.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
local Runner = require("tests.indent.common").Runner
|
||||
--local XFAIL = require("tests.indent.common").XFAIL
|
||||
|
||||
local run = Runner:new(it, "tests/indent/java", {
|
||||
tabstop = 2,
|
||||
shiftwidth = 2,
|
||||
softtabstop = 0,
|
||||
expandtab = true,
|
||||
})
|
||||
|
||||
describe("indent Java:", function()
|
||||
describe("whole file:", function()
|
||||
run:whole_file(".", {
|
||||
expected_failures = {},
|
||||
})
|
||||
end)
|
||||
|
||||
describe("new line:", function()
|
||||
run:new_line("method.java", { on_line = 1, text = "void foo() {}", indent = 2 })
|
||||
run:new_line("issue_2571.java", { on_line = 5, text = "void bar() {}", indent = 2 })
|
||||
end)
|
||||
end)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue