PHP Tools for Visual Studio v1.64.15602

PHP Tools for Visual Studio v1.64.15602
Improves PHP Editor with full support for generics.


Feature Release

May 06, 2022 - 9:36
PHP Tools for Visual Studio v1.64.15602
PHP Tools for Visual Studio adds support for Generics.
  • Generic Types - The syntax for generics is now fully supported. This improves eventual code completion and code refactoring wherever the generic types are either specified or inferred by the editor.
  • Generic PHPDoc Syntax - Additional documentary tags and keywords are now recognized. This includes the following tags:
    • @template annotates a class/interface/trait or a function generic argument.
    • @extends allows you to specify generic types for a base class.
    • @implements specifies generic types for base interfaces.
    • @use specifies generic types for the used trait.
    • The corresponding variations prefixed with @psalm- or @phpstan-, which basically means the same.
  • Completion After Generics - The generic arguments are now respected by the code analysis and IntelliSense. Wherever possible, they are substituted with the inferred types.
  • Infer Generic Types from Constructor - Generic types can now be inferred from the class constructor. The editor matches values provided to the constructor against the class generic arguments and resolves them.
  • Laravel Collections and Doctrine Collections - Since Laravel 9, most of the classes are annotated with @template tags, allowing the editor to provide better code completion. This release of PHP Tools allows to use Laravel generic types as well.
  • Generic Types in Tool Tips - Generics are now also shown in the corresponding tool-tips, so it is obvious what types were annotated and substituted.
  • Supports Psalm and PHPStan names - The PHPDoc tags prefixed with @psalm- and @phpstan- are now supported, and the special types that might be used within those tags are now properly parsed.
    • This includes generic types syntax, arrays with specified element types, specialized type names such as non-empty-array, class-name, etc.
  • Other Improvements:
    • Debug output no longer contains unimportant internal messages.
    • Debug exception handling has been improved, when there is a syntax error, full CallStack is displayed.
    • Improved IntelliSense completion pre-selection.
    • Updated PHP and Xdebug distributions.