Skip to content

Commit a392bb5

Browse files
debugger: Add basic inline values support (#84)
This PR adds support for basic inline values for PHP. I think these are the most commonly used inline values. If we need to add support for more advanced structures, we can do that later. <img width="740" height="447" alt="Screenshot 2025-12-06 at 17 59 06" src="https://github.com/user-attachments/assets/8e6d8585-37e0-48fc-8c66-4d52657e7284" />
1 parent 1d18aae commit a392bb5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

languages/php/debugger.scm

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
; e.g. `$age = 25` matches `$age`
2+
(expression_statement
3+
(assignment_expression
4+
left: (variable_name) @debug-variable
5+
)
6+
)
7+
8+
; e.g. `++$age` matches `$age`
9+
(expression_statement
10+
(update_expression
11+
argument: (variable_name) @debug-variable
12+
)
13+
)
14+
15+
; e.g. `if ($age > 18)` matches `$age`
16+
(binary_expression
17+
left: (variable_name) @debug-variable
18+
)
19+
20+
; e.g. `if (18 < $age)` matches `$age`
21+
(binary_expression
22+
right: (variable_name) @debug-variable
23+
)
24+
25+
; e.g. `__construct(int $age)` matches `$age`
26+
(simple_parameter
27+
name: (variable_name) @debug-variable
28+
)

0 commit comments

Comments
 (0)