Skip to content

Commit 2d7f9af

Browse files
committed
Update docs
1 parent a4ce144 commit 2d7f9af

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PHPantom focuses on completion and go-to-definition and aims to do them really w
1212
| | PHPantom | Intelephense | PHP Tools | Phpactor | PHPStorm |
1313
|---|---|---|---|---|---|
1414
| Completion ||||||
15+
| Auto-import || 💰 ||||
1516
| Go-to-definition ||||||
1617
| Go-to-implementation ||||||
1718
| `@mixin` completion || 💰 ||||
@@ -38,7 +39,8 @@ PHPantom focuses on completion and go-to-definition and aims to do them really w
3839
- **Guard clause stacking.** Early return narrows subsequent code. Multiple guards stack to whittle a union down. Works in ternaries, `match(true)`, with `is_a()`, `assert()`.
3940
- **Generic collection foreach.** Iterating `Collection<User>`, `Generator<int, Item>`, or a class with `@implements IteratorAggregate<int, User>` resolves the loop variable to the element type. Keys too.
4041
- **Generics.** `@template` with type substitution through inheritance chains and at call sites.
41-
- **Everything else you'd expect.** `foreach`, `clone`, `$arr[] = new Foo()`, destructuring with named keys, chained method calls in assignments.
42+
- **Conditional return types.** PHPStan-style `@return ($param is class-string<T> ? T : mixed)` resolves to the concrete branch at each call site.
43+
- **Everything else you'd expect.** Named arguments completion, destructuring with named keys, chained method calls in assignments, `@deprecated` detection.
4244

4345
## Project Awareness
4446

docs/todo.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@ before comparison.
3434

3535
---
3636

37+
## Completion Gaps
38+
39+
### 15. `unset()` tracking
40+
**Priority: Medium**
41+
42+
`unset($var)` removes a variable from scope, and `unset($arr['key'])` removes
43+
a key from an array shape. Neither is tracked today.
44+
45+
- **Variable scope.** After `unset($x)`, the variable `$x` should no longer
46+
appear in variable name suggestions, and `$x->` should not resolve to the
47+
type it had before the `unset`.
48+
- **Array shape keys.** After `unset($config['host'])`, the key `host` should
49+
no longer appear in `$config['` key completions, and the inferred shape
50+
should reflect its removal.
51+
52+
Both cases require the assignment/variable scanner in
53+
`completion/variable_resolution.rs` to recognise `unset(...)` statements
54+
and update its tracking accordingly.
55+
56+
---
57+
3758
## Missing LSP Features
3859

3960
### 6. Hover (`textDocument/hover`)

0 commit comments

Comments
 (0)