Skip to content

Indentation of functions prefixed with attribute #39

@zonuexe

Description

@zonuexe

M-x treesit-check-indent php-ts-mode

diff -u /var/folders/pg/c8fzpdv12hxbcqr9tg9hyl0r0000gn/T/buffer-content-8QRWS0 /var/folders/pg/c8fzpdv12hxbcqr9tg9hyl0r0000gn/T/buffer-content-Ai7ymh
--- /var/folders/pg/c8fzpdv12hxbcqr9tg9hyl0r0000gn/T/buffer-content-8QRWS0	2023-08-28 21:00:10
+++ /var/folders/pg/c8fzpdv12hxbcqr9tg9hyl0r0000gn/T/buffer-content-Ai7ymh	2023-08-28 21:00:10
@@ -6,23 +6,23 @@
  * @return never
  */
 #[\ReturnTypeWillChange()]
-function f(int|string $v = null): void
-{
-    $foo;
-    $foo = $v ?: [];
-    $n = (int)$v;
-    $datetime = new DateTimeImmutable();
+    function f(int|string $v = null): void
+    {
+        $foo;
+        $foo = $v ?: [];
+        $n = (int)$v;
+        $datetime = new DateTimeImmutable();
 
-    echo __FILE__;
-    if (true) {
-        echo "foo.{$v}";
-    } else {
-        list($a, $b) = array(1, 3);
-        echo $datetime->format('Y-m-d H:i:s'), PHP_EOL;
+        echo __FILE__;
+        if (true) {
+            echo "foo.{$v}";
+        } else {
+            list($a, $b) = array(1, 3);
+            echo $datetime->format('Y-m-d H:i:s'), PHP_EOL;
+        }
+        $class = LogicException::class;
+        throw new LogicException('test');
     }
-    $class = LogicException::class;
-    throw new LogicException('test');
-}
 
 ?>
 <!DOCTYPE html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions