mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
fix(php): do not indent after class/enum decl
This commit is contained in:
parent
ebdffa78bd
commit
53c79ddc28
3 changed files with 23 additions and 0 deletions
|
|
@ -40,6 +40,12 @@
|
||||||
(compound_statement
|
(compound_statement
|
||||||
"}" @indent.end)
|
"}" @indent.end)
|
||||||
|
|
||||||
|
(declaration_list
|
||||||
|
"}" @indent.end)
|
||||||
|
|
||||||
|
(enum_declaration_list
|
||||||
|
"}" @indent.end)
|
||||||
|
|
||||||
(return_statement
|
(return_statement
|
||||||
";" @indent.end)
|
";" @indent.end)
|
||||||
|
|
||||||
|
|
|
||||||
12
tests/indent/php/issue-6888.php
Normal file
12
tests/indent/php/issue-6888.php
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
enum DaysOfWeek: int
|
||||||
|
{
|
||||||
|
case Sunday = 0;
|
||||||
|
case Monday = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
public int $id;
|
||||||
|
public string $brand;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -62,5 +62,10 @@ describe("indent PHP:", function()
|
||||||
run:new_line("issue-4848.php", { on_line = 64, text = "return $a;", indent = 12 })
|
run:new_line("issue-4848.php", { on_line = 64, text = "return $a;", indent = 12 })
|
||||||
run:new_line("issue-4848.php", { on_line = 65, text = "$a,", indent = 8 })
|
run:new_line("issue-4848.php", { on_line = 65, text = "$a,", indent = 8 })
|
||||||
run:new_line("issue-4848.php", { on_line = 66, text = "$a;", indent = 0 })
|
run:new_line("issue-4848.php", { on_line = 66, text = "$a;", indent = 0 })
|
||||||
|
run:new_line("issue-6888.php", { on_line = 2, text = "$a;", indent = 0 })
|
||||||
|
run:new_line("issue-6888.php", { on_line = 3, text = "case Funday = 2;", indent = 4 })
|
||||||
|
run:new_line("issue-6888.php", { on_line = 6, text = "$a;", indent = 0 })
|
||||||
|
run:new_line("issue-6888.php", { on_line = 8, text = "$a;", indent = 4 })
|
||||||
|
run:new_line("issue-6888.php", { on_line = 11, text = "$a;", indent = 0 })
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue