Releases: Tusk-PHP/lsp
Releases · Tusk-PHP/lsp
0.8.0
Added
- Hover cards for
composer.jsonrequireandrequire-deventries: hovering a package name shows its installed version (read fromcomposer.lock), version constraint, PHP requirement with a compatibility glyph against the workspace PHP version, license, description, and a link to the package's Packagist or VCS page. - Go-to-Definition on a
composer.jsonpackage name can open the package's Packagist (or configured repository) page in the browser, gated by the newcomposer.openOnDefinitionsetting and the editor'swindow/showDocumentsupport. - New settings
tuskPhpLsp.composer.hover.enable(default on) andtuskPhpLsp.composer.openOnDefinition(default off) in the VS Code extension. - VS Code extension now activates on workspaces containing a
composer.jsonand routes JSON files matching that pattern to the server. - Zed extension now registers JSON as a handled language so
composer.jsonfiles are routed to the server for hover and definition. - Attribute completion now surfaces indexed attribute classes (user-defined and from vendor) that match the typed prefix, with automatic
use-import edits inserted alongside the existing built-in attribute suggestions.
Fixed
- PHP 8 attributes with constructor arguments — such as
#[Char("name", nullable: true)]— no longer generate spurious "unknown function" diagnostics for the call inside the attribute. - Named arguments inside attribute constructors — such as
nullable: true— no longer generate spurious "unknown attribute" diagnostics.
0.7.0
Added
- Generated PHP built-in symbol registry covering functions, classes, interfaces, and traits from PHP's internal runtime tables, preventing known PHP symbols from being reported as unknown when no richer stub exists yet.
- Embedded, versioned PHP stub layers for core symbols and extensions, including initial PHP 7.4/8.0 core stubs and JSON extension stubs through PHP 8.3.
- Project-aware builtin profile selection from Composer platform data, Composer
require.phpconstraints, requiredext-*packages, local PHP detection, and the bundled default profile. builtin-unavailablediagnostics for known PHP builtins that exist outside the project's selected PHP version or enabled extension set, such as PHP 8 functions used in a PHP 7.4 project.- Local PHP version detection via the
phpbinary, with configurable timeout handling and fallback to bundled stubs when detection is unavailable. - PHP manual URL generation for builtin methods, properties, class constants, predefined constants, classes, interfaces, traits, enums, and functions.
- Configurable PHP manual locale through
php_manual_locale. - Optional browser opening for builtin definitions through
php_manual_open_on_definition, using the LSPwindow/showDocumentcapability when supported by the client. - VS Code settings for PHP manual locale and builtin definition opening.
- A builtin-generation helper script for registry, stub, and availability metadata generation.
- Additional resolver support for
class-string<T>constructor binding, typed access-chain walking,foreachelement propagation, and Reflection generic metadata. - Unknown PHP attribute diagnostics, including detection for builtin attributes that are unavailable in the selected PHP profile.
Changed
- Builtin registration now uses profile-aware stub layering, with generated fallback symbols loaded before richer curated stubs.
- LSP initialization now resolves and logs the effective PHP builtin profile from Composer, local PHP, or bundled defaults.
- Unknown-symbol diagnostics use a softer mode while indexing settles, reducing noisy false positives during startup.
- Hover and definition resolution now use declaring classes for inherited builtin members so PHP manual links point to the correct manual page.
- Hover resolution now prefers PHPDoc
@returntypes over broad native placeholder types such asobject,mixed, andarraywhen that gives a more useful result. - Documentation was refreshed for project architecture, builtin navigation, and the new PHP manual settings.
- Moved the Go module and repository references from
github.com/open-southeners/tusk-phptogithub.com/Tusk-PHP/lsp, including internal Go imports, release/download URLs, and contributor documentation.
Fixed
- Unknown-function and unknown-class diagnostics no longer flag broad PHP builtins such as
array_reverse,ReflectionObject,ReflectionMethod, andInvalidArgumentException. - Builtin symbols are filtered from workspace navigation results where jumping to generated or embedded builtin declarations would be unhelpful.
- Class properties are excluded from standalone name lookup, preventing property symbols from resolving as unrelated bare identifiers.
- Manual links for receiver-class and inherited-member hovers now strip leading namespace separators and resolve against the correct owner class.
- Hover and resolver behavior for unknown typed class variables, property access chains, and string-based variable assignments is more accurate.
- Attribute syntax and local PHP detection timeout handling are covered by the resolved diagnostic follow-ups.
0.6.1
Added
- Composer-generated
vendor/composer/autoload_files.phpparsing so global helper files registered through Composer are indexed even when package metadata is unavailable or incomplete. - Additional PHP built-in function symbols for common array, regex, type-checking, constant, class, object, and function-introspection helpers.
Fixed
- Hover cards no longer resolve words inside PHP string literals as unrelated symbols, preventing array declaration keys such as
'environment' => [...]from showing constant or method hover cards. - Unknown-function diagnostics no longer flag PHP built-ins such as
get_class()or indexed Laravel/Composer global helpers such asclass_basename().
0.6.0
Added
- Configurable inlay hints for inferred variable types,
foreachkey/value types, closure and method return types, and call-site parameter names. - New LSP navigation surfaces for type definitions, implementations, document highlights, folding ranges, and richer workspace symbol results.
- Native unknown-symbol diagnostics for unresolved classes, functions, and members.
- Code actions for unused imports, import organization, and unknown-class import quick fixes.
- Refactor code actions for implementing missing methods, generating constructors, generating getters and setters, extracting variables, and conservatively inlining local variables.
- Structured PHPDoc support for conditional type rendering and local type-alias resolution across completion, hover, and type resolution.
- Laravel route, view, and translation metadata indexes with completion and definition support for framework string references.
- Symfony route-name intelligence for attribute routes plus YAML/XML route config and imported route resources.
- Symfony container discovery for YAML and PHP service configuration, including fluent PHP
set()andalias()definitions.
Changed
- Renamed the server binary, bundled editor binaries, logs, and project config references from
php-lsptotusk-php. - Cursor analysis and scoped variable tracking now model position-aware namespaces/imports, free functions, closures, arrow functions, grouped imports, closure captures, destructuring, and assignment metadata used by rename and refactor actions.
- Container service-ID navigation now distinguishes service-definition locations from type-definition targets.
- Inlay hints render shorter type names when fully qualified names can be reduced for display.
Fixed
- Generic and docblock type resolution for annotated parameters and union generic carriers, including recursion isolation for concurrent resolver work.
- Parser recovery errors are preserved and published as syntax diagnostics with stable locations for malformed input.
- Enum interface implementations now participate in implementation lookup.
- Variable rename preparation no longer advertises unsupported unscoped variable renames.
- Position-aware cursor scope and import resolution prevent later namespace/import state from leaking into earlier source regions.
0.5.0
Added
- PHP 8.3–8.5 syntax support in the parser: property hooks (
{ get => ...; set => ...; }), the|>pipe operator, asymmetric visibility (public private(set)), and dynamic class constant fetch (Class::{$name}) — constructs that were previously silently dropped or mis-parsed. - Hover cards for properties now show PHP 8.4 property hooks and asymmetric
(set)visibility.
Changed
- Faster workspace-wide symbol prefix search via binary lookup, improving completion responsiveness on large projects.
- Find references now reuses indexed in-memory source instead of re-reading every file from disk on each request.
- Large files are indexed off the JSON-RPC message loop, keeping the server responsive while big documents are processed.
Fixed
- Fatal crash (stack overflow) in hover and completion when resolving self-referential or mutually-referential variable assignments.
- Excessive work and apparent hangs in the variable-type chain resolver on certain repeated assignment patterns.
- Property hook bodies leaking their local variables (
$value,$this) as spurious class properties in completion and document symbols. - Completion returning blank entries when completing namespace segments in
usestatements. - Completion results being returned in a non-deterministic order between identical requests.
- Signature help highlighting a parameter position past the end of the parameter list when more arguments than parameters were typed.
0.4.0
Added
- Laravel Facade support: static calls like
Cache::get()now resolve through the container viagetFacadeAccessor(), providing completions and hover cards from the concrete class's methods. - Facade concrete method completion: methods not declared in
@method staticannotations but present on the resolved concrete class are surfaced as static completions. - Nested trait member resolution at all depth levels (trait using another trait using another trait, etc.), propagating methods and properties through the full chain.
Fixed
@method staticdocblock annotations not settingIsStaticon virtual members, causing them to be filtered out ofClassName::completions.- Trait
usedeclarations inside other traits being silently discarded by the parser, preventing nested trait members from appearing in completions and hover. traitMapentries not being cleaned up on file re-index, causing stale trait associations to persist until process restart.- Windows workspace path containing percent-encoded characters (
%3Afor:) not being decoded, causing the LSP server to index zero files. - All
file://URI-to-path conversions now use proper URL decoding and Windows drive letter handling via the sharedsymbols.URIToPathhelper.
0.3.2
Fixed
- VSCode extension shipping without bundled LSP binaries due to release CI not copying platform binaries into the extension's
bin/directory before packaging the.vsix.
0.3.1
Fixed
- VSCode extension failing to start the bundled LSP binary on Windows (
spawn php-lsp ENOENT) by appending.exeto the PATH fallback command. - VSCode extension failing to start the bundled LSP binary on Linux/macOS remote environments by ensuring execute permissions after
.vsixextraction. - Zed extension build failure caused by
unicode-segmentation1.13.0 breakingheck0.4.1 (UnicodeWordsmade private); pinned to 1.12.0.
0.3.0
Added
- Generic-aware type resolution for template-annotated classes and methods, preserving concrete type parameters through completions, hover, and chained calls.
- Generic-aware support for Laravel Eloquent builders and collections, including concrete model propagation for methods such as
query(),where(),get(),first(),find(), and related collection helpers. - Array literal and array-shape inference in resolved expression types, improving type preservation for inferred variables and collection payloads.
- Local
scripts/set-version.shutility to update repository version strings for releases.
Changed
- Release automation now targets plain semantic version tags without the previous release prefix.
- Expanded Laravel and Symfony end-to-end fixtures and coverage around generics, array shapes, and framework controller flows.
Fixed
- Incorrect generic propagation across LSP completions, hover results, and shared resolver paths.
- Variable type inference for generic return values, including Laravel helpers such as
Arr::first()andCollection::first(). - Symfony test fixture compatibility issues that were causing CI instability.
0.2.0
Added
- Multi-source model attribute discovery for Eloquent and Doctrine ORM models.
- Virtual property injection from
@property/@methoddocblock tags on classes. - IDE helper file support (
_ide_helper_models.php,_ide_helper.php) with member merging into existing indexed classes. - Eloquent relation discovery from method return types and
$this->hasMany()/belongsTo()/etc. calls. - Eloquent accessor/mutator detection (both legacy
getNameAttribute()and modernAttributecast). - Eloquent virtual static methods (
where,find,first,with,orderBy, etc.) mimicking__callStaticforwarding. - Doctrine ORM entity support:
#[Column],#[Id],#[GeneratedValue],#[OneToMany],#[ManyToOne],#[OneToOne],#[ManyToMany]PHP 8 attribute parsing. - Doctrine repository class detection and association to entities via
#[Entity(repositoryClass: ...)]. - Database schema introspection for MySQL, PostgreSQL, and SQLite via
.envcredentials with in-memory caching. - Laravel migration file parsing to extract column definitions (
$table->string(),$table->foreignId(),$table->timestamps(), etc.). - Builder string argument completion for column names inside
where(',orderBy(',select(',pluck(',groupBy(', etc. - Builder string argument completion for relation names inside
with(',has(',whereHas(',load(',withCount(', etc. - Array argument support for Builder completions (
select([',get([',with([', etc.). - Strict DB-only column filtering for
get()(only suggests columns from IDE helper, database introspection, or migrations). .envfile parser for reading database connection settings.databaseconfiguration option in LSP initialization settings to enable/disable DB introspection.- Built-in diagnostics engine with standalone
internal/checks/package reusable by CLI tools and CI pipelines. - Unused import detection with word-boundary scanning, aliased imports,
use function/use const, and PHP 8 attributes. - Unused private method and property detection (excludes magic methods).
- Unreachable code detection after
return,throw,exit/die,continue,break. - Redundant union member detection (duplicates,
?Type|null, supertype subsumption formixed,object,iterable). - Redundant nullsafe
?->operator detection on non-nullable types. - Unknown column validation in Builder string arguments (
where,orderBy,select,get, etc.). - Unknown relation validation in Builder string arguments (
with,has,whereHas,load, etc.). - Aggregate relation method second-arg validation (
withSum('relation', 'column')checks column on the related model). DiagnosticTagsupport: unused code greyed out (Unnecessary), deprecated functions struck through (Deprecated).diagnosticRulesconfiguration in.php-lsp.jsonto enable/disable individual diagnostic rules.- Multi-line method chain resolution for hover, go-to-definition, and completions.
resolve.JoinChainLines()helper to join continuation lines starting with->,::, or?->.- Comprehensive chain resolution test suite covering single-line and multi-line Eloquent method chains.
Fixed
- Hover cards and go-to-definition landing on wrong vendor symbols when method chains span multiple lines.
- Completion provider now resolves multi-line chains correctly instead of falling through to global completions.