Releases: bmewburn/vscode-intelephense
Releases Β· bmewburn/vscode-intelephense
1.11.7 Pre-release
Changed
- Reducing to minimal union types is now less eager.
Fixed
- False undefined class constant in unreachable code.
- Cannot read properties of undefined (reading 'length') intelephense.js:2:2322561
1.11.6 Pre-Release
Added
- Handle phpstan call site variance syntax.
Changed
- Template types and metadata return types will no longer resolve to an argument type of
never
in order to prevent code being unintentionally marked unreachable following function/method calls. - Undefined property diagnostic now suppressed in
isset
,empty
,unset
, LHS of null coalesce to match PHP behaviour. - Type check of LHS of property access expression suppressed in
isset
,empty
,unset
, LHS of null coalesce to match PHP behaviour.
Fixed
float
parameter should permitint
as argument.- Type inference with
null
equality comparison. - Undefined variables not diagnosed inside closure.
- False undefined method diagnostics with templated parameters.
- Auto import function adding unnecessary
function
keyword when in group use list. - Variable type becoming mixed when passed by ref in closure use clause.
- Circular reference problem when trait has
@mixin
of the same class that exhibits it. - False argument count error when trait provides implementation for an interface and gives params default args.
- Unable to override variable type with
@var
if RHS of assignment contains closure.
1.11.5 Pre-Release
[1.11.5 - 2024-07-07]
Fixed
- Various control flow analysis issues.
- Performance and type inference issues with array read/writes.
- Type inference following
yield
expression. - False type error when unpacking templated type.
1.11.4 Pre-Release
[1.11.4 - 2024-07-04]
Fixed
- Invalid Argument Error e.toLspSymbolKind lib/intelephense.js:2:3058335
[1.11.3 - 2024-07-04]
Fixed
- Laravel eloquent builder queries losing model type.
- Template mapping between class with a base class method.
- Cannot read properties of undefined (reading 'length') when encountering attributed property declared with
var
.
1.11.2 Pre-Release
[1.11.2 - 2024-07-03] Pre-Release
Fixed
- Type inference for properties with default initialisers.
- Performance degradation in code with many array read and writes.
- False undefined variable after
while
loop with condition expression that resolves totrue
literal type. - Stack overflow when applying large text edits.
1.11.1 Pre-Release
[1.11.1 - 2024-07-02]
Changed
- When a trait has an annotated or abstract method and the real method definition is supplied by a base class, then go to definition will now go to the base class definition instead of the trait method declaration.
- Go to implementations now includes implementations provided by a trait where a class both uses the trait and implements the interface.
Fixed
- False diagnostic when type
class-string
passed tostring
constraint. - Setting
completion.suggestObjectOperatorStaticMethods
should beintelephense.completion.suggestObjectOperatorStaticMethods
. - Crash when parsing incomplete phpdoc type with template type args.
- Crash when encountering
trigger_error
call withE_USER_ERROR
as argument. - Conditional return types with default parameter argument.
1.11.0 Pre-release
Added
- Type Hierarchy. Premium
- Support for
key-of<Type>
utility type. - Support for
T[K]
index access utility types. - Completion suggestions for
$_SERVER
array keys. unset()
now set variable type tounset
.- Phpdoc unsealed array shape syntax -
array{foo: 'bar', ...<int, object>}
. - Support PHP 8.3 enum and class constant dynamic access syntax.
- Ability to turn formatter off/on with comments. Within PHP -
// @formatter:off
,// @formatter:on
. Within HTML -<!-- @formatter:off -->
. Within js/CSS -/* @formatter:off */
. - New setting to prefer
@psalm-
,@phpstan-
prefixed annotations when determining symbol type. Defaults tofalse
.intelephense.compatibility.preferPsalmPhpstanPrefixedAnnotations
. - Support for
@psalm-type
and@psalm-import-type
type aliases. Setintelephense.compatibility.preferPsalmPhpstanPrefixedAnnotations
totrue
to enable. - Support
@see
,@uses
,@link
annotations and inline variants. - Static member access completion/hover/references when scope is variable of type
class-string<Foo>
. - Hover on array shape string keys.
- New
intelephense.diagnostics.relaxedTypeCheck
setting. Defaults totrue
(previous version behaviour). This setting makes type checking less thorough by allowing contravariant (wider) types to also satisfy a type constraint. This is useful for projects that may have incomplete or innacurate typings. Set tofalse
for more thorough type checks. When this setting istrue
, thenoMixedTypeCheck
setting is ignored. - New
intelephense.diagnostics.noMixedTypeCheck
setting. Defaults totrue
(previous version behaviour). This setting turns off type checking for themixed
type. This is useful for projects that may have incomplete or innacurate typings. Set tofalse
to make type checking more thorough by not allowingmixed
to satisy any type constraint. This setting has no effect whenrelaxedTypeCheck
istrue
. - New
completion.suggestObjectOperatorStaticMethods
setting. PHP permits the calling of static methods using the object operator eg$obj->myStaticMethod();
. If you would prefer not to have static methods suggested in this context then set this value tofalse
. Defaults totrue
. - Parameter types are now injected into inline closure arguments to functions from the corresponding parameter annotated callable type. For example declaring
function doCallback($myCallback) {}
with annotation/** @param \Closure(Foo $param): void $myCallback **/
will result in type hints for$param
insidedoCallback(function ($param) { /* $param type is known */ });
- Support
@var
annotated type abovedefine
constants.
Changed
- Minimum VSCode version 1.82.
- Recommended nodejs version 20.
- Literal types and array shapes are now used for constants. eg the type of
const FOO = 'bar';
is now'bar'
instead ofstring
,const ARR = ['foo' => true]
is nowarray{foo: true}
instead ofarray
. $argv
is now typestring[]
.$http_response_header
is now typearray|unset
.$php_errmsg
is now typestring|unset
.- Updated stubs.
- Formatter now aims to be PER compliant. As such,
psr12
setting inintelephense.format.braces
has been removed andper
added. - Formatter now allows a single space or no space in unary logical negation.
- Empty class, trait, interface, enum, function, method bodies are formatted to
{}
with a single space preceeding{
. - Short anonymous functions are now formatted to have no space between
fn
and(
. - Improved multiline
foreach
expression formatting. - Formatter now allows a single space or no space before colon in alternate control statements.
- Formatter now allows a single space or newline + indent before opening brace in anonymous class.
- Formatter now allows semicolon to be placed on a separate line in multiline chained expression statements.
- Multiline arrays are now formatted to a single element per line.
- Formatter will preserve wrapped attibutes in HTML.
- When multiple method/function candidates are found for a call expression, the result will be a union of the return types of the functions/methods.
Fixed
- Template type resolution from args when arg is subtype of param type.
- Various control flow fixes and improvements.
- Missing or poorly displayed code blocks in hover/completion documentation for some built-in symbols.
- Array destructure with skipped elements.
- Shorthand ternary type inference.
- Incorrect import folding range.
- Param with optional array shape element not indicating element is optional when hovering.
- Hover on named arg of closure showing incorrect type
unset
. - Incorrect type inferred for dynamic object creation expression when dynamic type is union.
- Hover showing non php fenced codeblocks incorrectly.
- Stack overflow with deeply nested string concatenation (TYPO3 PackageArtifact.php).
- Incorrect return type for symbols with metadata and null default parameter value (Laravel
app()
); - Incorrect type when generating phpdoc for variadic params.
- Declare statement should accept comma separated directive list.
- Incorrect
$matches
type afterpreg_match_all
call. - Promoted property highlight.
- Code actions not showing when narrow or zero length range provided.
- Unable to
@disregard
errors in method header. - Unnecessary match expr format when operand of binary expr.
- Incorrect file rename if
composer.json
contains autoload paths without trailing/
. static::class
resolving to parent class name rather than child class name.- Trait method
self
return type not resolving to consuming class when used as implementation for interface method. - Don't show
iterable
as interface. - Variables typed as
iterable<Foo>
not working with array access notation. - Array destructure with
ArrayAccess
.