mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 01:10:02 -04:00
Fixed a bug where indentation was not correct for class/enum bodies that had an annotation
This commit is contained in:
parent
1b47af43ce
commit
18c558fd92
4 changed files with 8 additions and 2 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
[
|
[
|
||||||
(class_declaration)
|
|
||||||
(class_body)
|
(class_body)
|
||||||
(enum_declaration)
|
|
||||||
(enum_body)
|
(enum_body)
|
||||||
(constructor_declaration)
|
(constructor_declaration)
|
||||||
(constructor_body)
|
(constructor_body)
|
||||||
|
|
|
||||||
3
tests/indent/java/class_with_annotation.java
Normal file
3
tests/indent/java/class_with_annotation.java
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
@Nothing
|
||||||
|
public class Testo {
|
||||||
|
}
|
||||||
3
tests/indent/java/enum_with_annotation.java
Normal file
3
tests/indent/java/enum_with_annotation.java
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
@Nothing
|
||||||
|
public enum Testo {
|
||||||
|
}
|
||||||
|
|
@ -19,5 +19,7 @@ describe("indent Java:", function()
|
||||||
run:new_line("method.java", { on_line = 1, text = "void foo() {}", indent = 2 })
|
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 })
|
run:new_line("issue_2571.java", { on_line = 5, text = "void bar() {}", indent = 2 })
|
||||||
run:new_line("enum.java", { on_line = 2, text = "THING_B,", indent = 2 })
|
run:new_line("enum.java", { on_line = 2, text = "THING_B,", indent = 2 })
|
||||||
|
run:new_line("class_with_annotation.java", { on_line = 2, text = "void foo() {}", indent = 2 })
|
||||||
|
run:new_line("enum_with_annotation.java", { on_line = 2, text = "THING;", indent = 2 })
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue