diff options
| author | Carlos Afonso <afonso.carlos.braga@gmail.com> | 2023-10-06 18:34:46 +0100 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-10-15 14:34:32 -0400 |
| commit | bf87a16712124ed8485e359fda321861de769d2a (patch) | |
| tree | 3947a06b380f497116421db25a865a889ed1adb1 | |
| parent | fix(markdown): set block quote priority within allowed range (diff) | |
| download | nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.tar nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.tar.gz nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.tar.bz2 nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.tar.lz nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.tar.xz nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.tar.zst nvim-treesitter-bf87a16712124ed8485e359fda321861de769d2a.zip | |
fix(php): fix indentation for in between braces
| -rw-r--r-- | queries/php/indents.scm | 4 | ||||
| -rw-r--r-- | tests/indent/php/issue-3591.php | 1 | ||||
| -rw-r--r-- | tests/indent/php_spec.lua | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/queries/php/indents.scm b/queries/php/indents.scm index c490ad77f..a10791501 100644 --- a/queries/php/indents.scm +++ b/queries/php/indents.scm @@ -10,7 +10,6 @@ (switch_block) (match_block) (case_statement) - "[" ] @indent.begin [ @@ -25,4 +24,5 @@ (compound_statement "}" @indent.end) -(ERROR) @indent.auto +(ERROR "(" @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")") . (_)) +(ERROR "[" @indent.align (#set! indent.open_delimiter "[") (#set! indent.close_delimiter "]") . (_)) diff --git a/tests/indent/php/issue-3591.php b/tests/indent/php/issue-3591.php index 30b90a6a0..598948f5c 100644 --- a/tests/indent/php/issue-3591.php +++ b/tests/indent/php/issue-3591.php @@ -2,4 +2,5 @@ function test() { $array = [ + ] } diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua index 2d7a88742..f7067501e 100644 --- a/tests/indent/php_spec.lua +++ b/tests/indent/php_spec.lua @@ -21,7 +21,7 @@ describe("indent PHP:", function() { on_line = 5, text = "indentation with `enter` in insert mode is not correct", indent = 4 } ) run:new_line("issue-2497.php", { on_line = 5, text = "$a =", indent = 4 }) - run:new_line("unfinished-call.php", { on_line = 6, text = "$a =", indent = 0 }) + run:new_line("unfinished-call.php", { on_line = 6, text = "$a =", indent = 4 }) run:new_line("issue-3591.php", { on_line = 4, text = "$a =", indent = 8 }) run:new_line("enum-indent.php", { on_line = 4, text = "case", indent = 4 }) end) |
