aboutsummaryrefslogtreecommitdiffstats
path: root/queries/php_only/indents.scm
diff options
context:
space:
mode:
authortk-shirasaka <tk.shirasaka@gmail.com>2024-01-20 21:34:49 +0900
committerGitHub <noreply@github.com>2024-01-20 12:34:49 +0000
commit64b3d5e5698d485a4f197ffbe85a4b6c29e16325 (patch)
treedf6723ec690b4b4dad98cdcbffaa99c3a66b4587 /queries/php_only/indents.scm
parentfix(highlights): use `markup.raw.delimiter` for fences (diff)
downloadnvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.gz
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.bz2
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.lz
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.xz
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.zst
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.zip
feat: add the php_only parser included in tree-sitter-php (#5876)
Add parser `php_only` for PHP files without HTML embedded. Make queries for combined parser `php` inherit from `php_only` (no extensions needed). --------- Co-authored-by: shirasaka <tk.shirasaka@gmail>
Diffstat (limited to 'queries/php_only/indents.scm')
-rw-r--r--queries/php_only/indents.scm38
1 files changed, 38 insertions, 0 deletions
diff --git a/queries/php_only/indents.scm b/queries/php_only/indents.scm
new file mode 100644
index 000000000..a81faed62
--- /dev/null
+++ b/queries/php_only/indents.scm
@@ -0,0 +1,38 @@
+[
+ (array_creation_expression)
+ (compound_statement)
+ (declaration_list)
+ (binary_expression)
+ (return_statement)
+ (arguments)
+ (formal_parameters)
+ (enum_declaration_list)
+ (switch_block)
+ (match_block)
+ (case_statement)
+] @indent.begin
+
+[
+ ")"
+ "}"
+ "]"
+] @indent.branch
+
+(comment) @indent.auto
+
+(compound_statement
+ "}" @indent.end)
+
+(ERROR
+ "(" @indent.align
+ .
+ (_)
+ (#set! indent.open_delimiter "(")
+ (#set! indent.close_delimiter ")"))
+
+(ERROR
+ "[" @indent.align
+ .
+ (_)
+ (#set! indent.open_delimiter "[")
+ (#set! indent.close_delimiter "]"))