mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
indents(php): add another test
This commit is contained in:
parent
1b0a74afa8
commit
992926ab99
3 changed files with 15 additions and 3 deletions
|
|
@ -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" "()"))
|
||||
|
|
|
|||
6
tests/indent/php/example2.php
Normal file
6
tests/indent/php/example2.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
function()
|
||||
{
|
||||
$foo = 'bar';
|
||||
// indentation with `o` is correct
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue