diff options
| author | 再生花 <hoangtun0810@gmail.com> | 2024-07-09 10:12:29 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-09 10:12:29 +0900 |
| commit | 53c79ddc28b0df3263d629f5e20c9283b05841ca (patch) | |
| tree | e21c4ef3210554c9d703cdc61b6da047941c026c /tests/indent | |
| parent | fix(ruby): highlight "&." as `@punctuation.delimiter` (#6887) (diff) | |
| download | nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.tar nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.tar.gz nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.tar.bz2 nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.tar.lz nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.tar.xz nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.tar.zst nvim-treesitter-53c79ddc28b0df3263d629f5e20c9283b05841ca.zip | |
fix(php): do not indent after class/enum decl
Diffstat (limited to 'tests/indent')
| -rw-r--r-- | tests/indent/php/issue-6888.php | 12 | ||||
| -rw-r--r-- | tests/indent/php_spec.lua | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/indent/php/issue-6888.php b/tests/indent/php/issue-6888.php new file mode 100644 index 000000000..950cb8119 --- /dev/null +++ b/tests/indent/php/issue-6888.php @@ -0,0 +1,12 @@ +<?php
+enum DaysOfWeek: int
+{
+ case Sunday = 0;
+ case Monday = 1;
+}
+
+class Foo {
+ public int $id;
+ public string $brand;
+}
+?>
\ No newline at end of file diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua index 3fc681c29..2a41079ff 100644 --- a/tests/indent/php_spec.lua +++ b/tests/indent/php_spec.lua @@ -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 = 65, text = "$a,", indent = 8 }) 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) |
