indents(php): add another test

This commit is contained in:
Stephan Seitz 2022-01-24 21:16:00 +01:00
parent 1b0a74afa8
commit 992926ab99
3 changed files with 15 additions and 3 deletions

View file

@ -1,12 +1,9 @@
[
(array_creation_expression)
(arguments)
(formal_parameters)
(compound_statement)
(declaration_list)
(binary_expression)
(return_statement)
(expression_statement)
] @indent
[
@ -20,3 +17,8 @@
] @ignore
(compound_statement "}" @indent_end)
([
(arguments)
(formal_parameters)
] @aligned_indent
(#set! "delimiter" "()"))

View file

@ -0,0 +1,6 @@
<?php
function()
{
$foo = 'bar';
// indentation with `o` is correct
}

View file

@ -16,5 +16,9 @@ describe("indent PHP:", function()
describe("new line:", function()
run:new_line("example.php", { on_line = 11, text = "// new line starts 1 indentation to far", indent = 4 })
run:new_line(
"example2.php",
{ on_line = 5, text = "// indendation with `enter` in insert mode is not correct", indent = 4 }
)
end)
end)