File tree 2 files changed +30
-3
lines changed
tests/php-ts-mode-resources
2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 73
73
((parent-is " program" ) column-0 0 )
74
74
((parent-is " comment" ) parent-bol 1 )
75
75
((parent-is " declaration_list" ) parent-bol , offset )
76
- ((parent-is " function_definition" ) parent-bol , offset )
76
+ ; ; "compound_statement" contains the body of many statements.
77
+ ; ; For example function_definition, foreach_statement, etc.
77
78
((parent-is " compound_statement" ) parent-bol , offset )
78
79
((parent-is " array_creation_expression" ) parent-bol , offset )
79
80
((parent-is " base_clause" ) parent-bol , offset )
85
86
((parent-is " switch_block" ) parent-bol , offset )
86
87
((parent-is " case_statement" ) parent-bol , offset )
87
88
((parent-is " assignment_expression" ) parent-bol , offset )
88
- ((parent-is " return_statement" ) parent-bol , offset )
89
- )))
89
+ ((parent-is " return_statement" ) parent-bol , offset ))))
90
90
" Tree-sitter indent rules." )
91
91
92
92
(defvar php-ts-mode--keywords
Original file line number Diff line number Diff line change @@ -64,3 +64,30 @@ function ns_func(): void {
64
64
return;
65
65
}
66
66
=-=-=
67
+
68
+ Name: Function with an attribute
69
+
70
+ =-=
71
+ <?php
72
+
73
+ namespace Ns;
74
+
75
+ #[Attribute]
76
+ function with_an_attr(): void {
77
+ return;
78
+ }
79
+ =-=-=
80
+
81
+ Name: Function with two attributes
82
+
83
+ =-=
84
+ <?php
85
+
86
+ namespace Ns;
87
+
88
+ #[Attribute]
89
+ #[Attribute]
90
+ function with_two_attrs(): void {
91
+ return;
92
+ }
93
+ =-=-=
You can’t perform that action at this time.
0 commit comments