Skip to content

v0.2.5

Choose a tag to compare

@math3usmartins math3usmartins released this 14 Jun 22:12
· 4 commits to main since this release
e5a3923

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, with Collection<T>::first(): ?T and $users = new Collection::<User>(), $users->first()?->name now infers ?string; a ?-> access correctly makes the result nullable, and an intermediate property typed via a cross-namespace use import 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()->name where first() returns ?User reports Accessing "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.version now reports 0.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