You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
18
18
### Fixed
19
19
20
+
-**Parenthesized RHS expressions now resolved.** Assignments like `$var = (new Foo())` and `$var = ($cond ? $a : $b)` now resolve correctly through the AST path. Previously the `Expression::Parenthesized` wrapper was not unwrapped in `resolve_rhs_expression`.
21
+
-**`$var::` completion for class-string variables.** When a variable holds a class-string (e.g. `$cls = User::class`), using `$cls::` now offers the referenced class's static members, constants, and static properties. Handles `self::class`, `static::class`, `parent::class`, and unions from match/ternary/null-coalescing expressions.
20
22
-**`?->` chaining fallback now recurses correctly.** The `?->` fallback branch in subject extraction called `extract_simple_variable` instead of `extract_arrow_subject`. The primary `->` branch already handled `?->` chains correctly via a `?` skip, so this was not user-visible, but the fallback is now consistent.
21
23
-**Multi-extends interfaces now fully stored.** Interfaces extending multiple parents (e.g. `interface C extends A, B`) now store all parent names, not just the first one.
Copy file name to clipboardExpand all lines: docs/todo.md
-51Lines changed: 0 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,57 +11,6 @@ section.
11
11
12
12
## Completion & Go-to-Definition Gaps
13
13
14
-
### Quick wins
15
-
16
-
#### 28. Parenthesized RHS expression not unwrapped in variable resolution ✅ **[DONE]**
17
-
18
-
**Completed:**
19
-
`resolve_rhs_expression` now correctly unwraps `Expression::Parenthesized` nodes, so assignments like `$var = (new Foo())` and `$var = ($condition ? $a : $b)` resolve through the AST-based path.
20
-
21
-
---
22
-
23
-
#### 29 / 35. Namespace-level `const` declarations not indexed
24
-
25
-
Only `define('NAME', value)` calls are extracted and stored in
26
-
`global_defines`. PHP's `const NAME = value;` syntax at namespace or
27
-
top level is not indexed, so these constants don't appear in completion
28
-
and can't be navigated to via go-to-definition.
29
-
30
-
```php
31
-
namespace App\Config;
32
-
33
-
const MAX_RETRIES = 3; // ← not indexed, no completion or go-to-definition
34
-
define('APP_NAME', '…'); // ← works fine
35
-
```
36
-
37
-
**Fix:** in `extract_defines_from_statements`, also handle
38
-
`Statement::Constant` nodes and store their names (namespace-qualified)
39
-
in `global_defines`. This fixes both completion and go-to-definition
40
-
(§35) in one change.
41
-
42
-
---
43
-
44
-
#### 25. No completion after `$var::` where variable holds a class-string
45
-
46
-
When a variable holds a class-string value (e.g. from `$cls = User::class`),
47
-
using the `::` operator on it (`$cls::`) does not offer static members of
48
-
the referenced class. The subject `$cls` is passed to `resolve_target_classes`
49
-
which resolves it to its *value type* (`string` / `class-string`) rather than
50
-
the *referenced class* (`User`).
51
-
52
-
```php
53
-
$cls = User::class;
54
-
$cls:: // ← no completion (should offer User's static members/constants)
55
-
```
56
-
57
-
**Fix:** in `resolve_target_classes`, when the subject is a bare `$var`
58
-
and `access_kind` is `DoubleColon`, check if the variable was assigned a
59
-
`Foo::class` literal (or a union of `::class` literals from a match
60
-
expression). If so, resolve to those class(es) instead of the variable's
61
-
value type.
62
-
63
-
---
64
-
65
14
### High impact
66
15
67
16
#### 23. Match-expression class-string not forwarded to conditional return types
0 commit comments