Releases: xphp-lang/language-server
v0.2.5
Added
- Type inference now follows nullable and nullsafe chains. Member access through
?->, multi-hop chains, cross-namespace member types, and non-generic methods mid-chain all resolve to concrete types -- so hover, inlay hints, and completion stay accurate further into an expression. For example, withCollection<T>::first(): ?Tand$users = new Collection::<User>(),$users->first()?->namenow infers?string; a?->access correctly makes the result nullable, and an intermediate property typed via a cross-namespaceuseimport resolves to its full FQN. - Go to Definition works through nullsafe method chains. Ctrl+click on the final call in a chain like
$bag->first()?->spin()now jumps to the method declaration (previously only plain->chains were followed). - New diagnostic: possible null dereference (
xphp.null-deref). A property/method accessed with plain->on a statically nullable chained receiver is flagged as a Warning -- e.g.$users->first()->namewherefirst()returns?UserreportsAccessing "name" on a possibly-null value (?App\Models\User). Use ?-> or guard against null first.The check is deliberately conservative: it does not fire on the nullsafe form (?->) or on a non-nullable receiver, and it defers bare-variable cases ($x->y) to avoid false positives.
Notes
serverInfo.versionnow reports0.2.5.- All changes are server-side only; no client/plugin update required.
- Internal: a range-bounds invariant ("every emitted range stays within the document") is now locked by tests across the same-document range handlers (semantic tokens, folding, document symbol, code lens, inlay hint, document highlight), guarding against the EOF-anchored "Range must be inside element being annotated" class of crash.
Full Changelog: v0.2.4...v0.2.5
v0.2.4
What's Changed
Fixed
Diagnostics no longer crash the PhpStorm annotator
An EOF-anchored syntax error (unterminated comment, "unexpected EOF") could produce a diagnostic whose range ended one character past end-of-document, which strict LSP clients reject with Range must be inside element being annotated -- poisoning the diagnostics provider for the rest of the session. Every emitted diagnostic range is now clamped into the analyzed buffer (parser, undefined-name, and workspace diagnostics alike).
Added
Hover substitutes generic type parameters on property access
Hovering a property reached through a generic receiver now shows the concrete type instead of the raw declared type parameter. For example, hovering ->first on $nested->swap()->first (where $nested: Pair<Map<string, int>, Pair<Plastic, User>>) now shows public App\Pair<App\Plastic, App\User> $first instead of public A $first -- matching what hovering the assigned variable already showed.
Notes
serverInfo.versionnow reports0.2.4.- Both changes are server-side only; no client/plugin update required.
Full Changelog: v0.2.3...v0.2.4
v0.2.3
What's Changed
Full changelog at v0.2.2...v0.2.3
Fixed
Generics semantic tokens now read correctly.
Concrete type arguments at turbofish call sites were highlighted as typeParameter, which (per the LSP spec) denotes a formal type variable like T -- not a type supplied at a use site. Each argument is now classified by what it actually is:
- builtin/scalar args (
int,string,bool, ...) ->type - named user types (
User,Banana, ...) ->class - a forwarded in-scope type variable (passing
Talong inside a generic body) ->typeParameter
Formal type parameters in declarations (class Box<T>, fn<T>) and reified-T uses stay typeParameter as before.
Added
- Turbofish punctuation is now highlighted. The
::,<, and>delimiters of a generic clause emitoperatortokens instead of rendering uncolored.
Notes
- This is purely a server-side token-emission change -- no client/plugin updates required. The
typeandoperatortoken types were already in the published legend. serverInfo.versionnow reports0.2.3.
Example
Util::identity::<int>(42)
Util= classidentity= methodint= type (was typeParameter)::<>= operator (were uncolored).
v0.2.2
What's Changed
- ci(release): bump version in server info sent to clients by @math3usmartins in #9
Full Changelog: v0.2.1...v0.2.2
What's Changed
- ci(release): bump version in server info sent to clients by @math3usmartins in #9
Full Changelog: v0.2.1...v0.2.2
v0.2.1
What's Changed
- ci(release): tolerate the PHAR smoke-test timeout under errexit by @math3usmartins in #7
- fix(semantic-tokens): split multiline tokens one per line by @math3usmartins in #8
Full Changelog: v0.2.0...v0.2.1
v0.2.0
v0.2.0
Full editor support for xphp v0.2.0 generics — the turbofish call syntax, composite bounds, and variance — plus a cross-editor "Show references" fix and sharper generic type inference.
Requires xphp
^v0.2.0. This release targets the generics-capable compiler;serverInfonow reports0.2.0.
Highlights
Generics: the turbofish call syntax (Foo::<int>)
The server now recognizes xphp's turbofish call-site syntax everywhere — new Collection::<User>(), Util::identity::<int>(...), and $obj->method::<int>(...). Highlighting, completion, hover, signature help, go-to-definition, and diagnostics all understand it.
- Instance-method turbofish resolves to concrete types —
$x = $u->identity::<int>(99)now infersint(hover + inlay hint) instead of the bare type parameterT, even on a non-generic receiver. - Relative return types resolve to the receiver — a method declared
: static/: self(e.g. a fluentfresh(): static) on aBuilder<int>receiver now showsBuilder<int>, not the literalstatic. - Omitted default type arguments are tolerated — no more spurious errors when defaults are left off.
- Generic closures and arrow functions are highlighted.
Type-parameter bounds
- Composite bounds (
T: A & B) are understood end-to-end. - Bound-violation quick-fixes are composite-aware — the fix-it offers the right type(s) to satisfy a multi-bound parameter.
Hover
- Variance is shown — hovering a
+T/-Tparameter explains its covariance / contravariance. - Generic instantiations and method calls render their specialized types.
"Show references" CodeLens
The lens command was reworked to a neutral, namespaced xphp.showReferences that different clients can handle correctly. e.g. PhpStorm opens its native usage popup, VS Code opens the references peek with no server round-trip. (Requires the matching VS Code extension / PhpStorm plugin update — older clients won't pick up the new command id.)
Fixes
- Turbofish highlighting, type-argument arity checks, and bound fix-its corrected.
- Semantic tokens no longer mistake a bareword comparison for a generic declaration.
serverInfo.versioncorrectly reports0.2.0.
Performance
PositionMapis memoized per(uri, version), avoiding repeated rebuilds on hot paths (hover, definition, diagnostics).
Under the hood
- Bounds are now read through a
BoundExprview (cleaner composite-bound handling). - Expanded generics test coverage (self/static/parent turbofish, instance/variable argument checks, over-supplied turbofish) with mutation-test hardening; a filesystem-order-dependent diagnostics test was made deterministic for reliable CI.
v0.1.1
What's Changed
- docs: sync roadmap + README with shipped features 9eb7cfa
- fix(references): track
new X()as a usage of X::__construct 9dc9c55 - docs(behat): document the in-memory coverage boundary 8f225d9
- feat(fqn-index): index fixture trees (remove the test/fixture skip) b1c1609
- feat(diagnostics): single-source the bound-check hierarchy by proximity 19a9cc1
- feat(fqn-index): anchor resolution to the requesting document cf63b43
- refactor(fqn-index): proximity-aware resolution foundation 0c4111d
- feat: read/write kind on document highlight 2b56161
- feat: semantic tokens for interpolation + non-ASCII b860ff7
- feat: quick-fixes for generic bound violations 55dc893
- feat: broadcast diagnostics to dependent open files fb27fc5
- feat: arg-type checking for method/static/fn calls 2a003fd
- docs(behat): both @todo features are now implemented 096041a
- feat(definition): resolve go-to-definition through a generic method call 14bc6a1
- feat(diagnostics): surface duplicate-template on every colliding file 194537a
- ci: run the Behat acceptance suite as a gate 1beab99
- test(find): add negative cases and a prefix Scenario Outline 15ff7f5
- test(validate): add a clean-file negative (no diagnostics) 386dd51
- test(understand): add negative cases and a signature-help Scenario Outline 4c7dbfa
- test(edit): add negative cases (no code actions / no rename edit) b1eec28
- test(navigate): add negative cases and a document-symbol Scenario Outline 308c333
- test(find): assert completion item kind/detail and exact resolve documentation a37e9cd
- test(validate): assert diagnostic underline spans (covered text) ede1f3e
- test(understand): tighten hover/signature/inlay/folding/tokens assertions 9d16bac
- test(edit): tighten code-action/lens/rename assertions to payloads 0cc4798
- test(navigate): tighten assertions to covered-text, structure, exact names af2b52d
- test(behat): replace step traits with constructor-injected context classes ed3ef6a
- test(behat): drive the real LSP dispatcher end-to-end 2b06c0b
- test(behat): organize features by theme; update docs and parallel target 48a2cb5
- test(find): completion-item resolve behavior spec 7597f47
- test(find): completion behavior spec 0b6f380
- test(validate): diagnostics behavior spec d1822a5
- test(understand): semantic-tokens behavior spec a043332
- test(understand): folding-range behavior spec 0f58384
- test(understand): signature-help behavior spec 36a04ae
- test(understand): inlay-hint behavior spec c34eb98
- test(understand): hover behavior spec 7c491e4
- test(edit): workspace/willRenameFiles behavior spec 8b2b1b0
- test(edit): code-lens behavior spec 83c0ada
- test(edit): code-action behavior spec ed591e9
- test(edit): rename behavior spec cd8063f
- test(navigate): type-hierarchy behavior spec fa875e0
- test(navigate): call-hierarchy behavior spec eba0774
- test(navigate): workspace-symbol search behavior spec 7349e13
- test(navigate): document-symbol outline behavior spec 0053f91
- test(navigate): document-highlight behavior spec 2ca815c
- test(navigate): go-to-implementation behavior spec b7b4ec8
- test(navigate): find-references behavior spec 4f93e5e
- test(navigate): go-to-type-definition behavior spec bf84ca7
- test(navigate): go-to-definition behavior specs 14c7043
- test(behat): split FeatureContext into per-theme step traits a70b2b8
- test(behat): open fixtures into one persistent workspace 290f727
- test: make the Gherkin specs executable with Behat (in-memory, parallel-safe) 912e953
- docs: add Gherkin specs for cross-file resolution behavior a50af5c
- ci: build and publish xphp-lsp PHAR on version tags 871eab7
Full Changelog: v0.1.0...v0.1.1
MVP: basic functionality to support xphp v0.1.0
Merge pull request #1 from xphp-lang/mvp MVP: basic functionality to support xphp v0.1.0