Skip to content

Commit 4bf9ddb

Browse files
authored
Add class properties to symbols outline (#103)
Currently class properties are not outlined and therefore not showing up in the symbol search in Zed Test case: ```php <?php class TestCase { public $noType; protected string $withType = "default"; private static array $static = []; protected readonly bool $readOnly; public function __construct(public bool $promotedProperty) {} } ``` Before this change: <img width="550" height="125" alt="image" src="https://github.com/user-attachments/assets/434f93e2-3a92-43b7-9dd3-cb9dc6d2546e" /> After this change: <img width="578" height="250" alt="image" src="https://github.com/user-attachments/assets/4b06ea8d-a25e-4bb8-a058-e03c215af60f" /> Ideally promoted class properties would also work, but this is a start.
1 parent f8becf0 commit 4bf9ddb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

languages/php/outline.scm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@
4444
) @item
4545

4646
(comment) @annotation
47+
48+
(property_declaration
49+
(property_element
50+
name: (variable_name) @name
51+
)
52+
) @item

0 commit comments

Comments
 (0)