Skip to content

Commit dc2365a

Browse files
committed
Update readme with latest features
1 parent 787cfa4 commit dc2365a

1 file changed

Lines changed: 35 additions & 11 deletions

File tree

README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,66 @@
11
# PHPantomLSP
22

3-
A PHP Language Server Protocol (LSP) implementation in Rust.
3+
A fast, lightweight PHP language server that stays out of your way. Using only a few MB of RAM regardless of project size, fully usable in milliseconds, without requiring high-end hardware.
44

5-
> **Note:** This project is in early development. Features are minimal.
5+
> **Note:** This project is in active development.
66
77
## Features
88

99
### Document Synchronization
1010

1111
- Full text document sync (open, change, close)
1212

13+
### Type Resolution
14+
15+
Both completion and go-to-definition draw from a shared type resolution engine:
16+
17+
- `$this`, `self`, `static`, and `parent` keyword resolution
18+
- Variable type inference from assignments (`$var = new Foo()`) and parameter type hints
19+
- Property chain and method call chaining (e.g. `$this->getService()->doSomething()`)
20+
- Function and static method call return type resolution (e.g. `app()->`, `Class::make()->`)
21+
- Inheritance-aware: walks the class hierarchy including traits
22+
- Enum case resolution
23+
- Union types: `A|B` in return types, property types, and parameter hints are split into individual candidates
24+
- Ambiguous variables: when a variable is assigned different types in conditional branches, all possible types are tried
25+
- PHPDoc support: `@return`, `@property`, `@method`, `@mixin`
26+
- PHPStan conditional return types: annotations like `@return ($abstract is class-string<TClass> ? TClass : mixed)` are resolved based on call-site arguments
27+
1328
### Completion
1429

1530
- Instance member completion via `->` (methods and properties)
16-
- Static member completion via `::` (static methods, static properties, and constants)
31+
- Static member completion via `::` (static methods, static properties, constants, and enum cases)
1732
- `parent::` completion (static and non-static members, excluding private)
18-
- `$this`, `self`, and `static` keyword resolution to the current class
19-
- Property chain resolution (e.g. `$this->service->`)
20-
- Variable type resolution from assignments (`$var = new Foo()`) and parameter type hints
21-
- Inheritance-aware completion — walks the class hierarchy to include inherited members
2233
- Magic method filtering (`__construct`, `__destruct`, etc. are excluded from results)
2334
- Full method signature display in completion labels (parameters, types, return type)
2435

2536
<img width="683" height="339" alt="image" src="https://github.com/user-attachments/assets/65e8220d-5d94-466f-aea7-2f239a8d4b19" />
2637

2738
### Go to Definition
2839

29-
- Jump to class, interface, trait, and enum definitions
40+
- Jump to class, interface, trait, enum, and standalone function definitions
41+
- Jump to method, property, and constant definitions on a class
3042
- Same-file and cross-file definition lookup
3143
- Fully-qualified, partially-qualified, and unqualified name resolution via `use` statements and the current namespace
3244

3345
### PHP Parsing
3446

35-
- Extracts classes, interfaces, methods, properties, and constants
36-
- Parses visibility modifiers, static modifiers, type hints, and parameter info
47+
- Extracts classes, interfaces, traits, and enums
48+
- Parses methods, properties, and constants with visibility, static modifiers, and type hints
49+
- Extracts standalone function definitions (global and namespaced)
3750
- Supports constructor-promoted properties
3851
- Parses `use` statements and namespace declarations
3952

53+
#### PHPDoc Parsing
54+
55+
Built on [Mago](https://github.com/carthage-software/mago)'s PHP parser.
56+
57+
- `@return` type extraction with compatibility checks against native type hints
58+
- `@var` type annotations
59+
- `@property` virtual property declarations
60+
- `@method` virtual method declarations
61+
- `@mixin` class delegation tags
62+
- PHPStan style conditional return type expressions (recursive/nested conditionals)
63+
4064
### Composer / PSR-4 Integration
4165

4266
- Parses `composer.json` for PSR-4 autoload mappings (`autoload` and `autoload-dev`)
@@ -93,4 +117,4 @@ See [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
93117

94118
## License
95119

96-
MIT see [LICENSE](LICENSE).
120+
MIT - see [LICENSE](LICENSE).

0 commit comments

Comments
 (0)