PHP Tools for Visual Studio v1.79.19431

Released: Mar 3, 2024

Updates in v1.79.19431

Features

  • AI Snippets - This update introduces smart snippets. Based on your code, the editor generates inline suggestions with placeholders.
  • Refactorings
    • Concatenation to String interpolation refactoring.
    • Smart if-else to switch refactorings.
  • Unnecessary Parentheses - Parentheses that can be safely removed are dimmed in the code now, and a corresponding code fix "Remove unnecessary parentheses" is available.
  • Formatting - Introduced the wrapping formatting option Compact empty body into '{}', which now automatically converts an empty function body into {} and maintains it on the same line as the preceding symbol, separated by a single space. Additionally, this release includes support for the wrapping option Always, ensuring that the appropriate syntax construct is always wrapped.
  • Changed the default behavior how braces are indented when present directly in switch items.
  • Improved type inferring and type checks.
  • Improved foreach type inferring when taking advantage of generic type arguments and _ide_helper.
  • IntelliSense for eloquent Model classes.
  • Support for psalm-yield doc comment tag, and infers yield result type accordingly.
  • Diagnostics for #[Override] attribute.
  • Support for phpdoc types trait-string, interface-string, enum-string, callable-string.
  • Support for phpcs:ignore comment.
  • Improves type inferring for array_rand() and is_array().
  • More Laravel Blade tags supported (extends, can), fixes syntax errors in blade tags.
  • Improves array type analysis for builtin array_* functions.
  • Understands more doc block tags prefixed with psalm-, i.e. psalm-property, psalm-readonly, psalm-trace, and more.
  • Inlay hint and variable highlighting for doc block tag trace or psalm-trace.
  • Respects never returning functions, function that exits, and function that always throws exception.
  • Type inferring for generic arguments inferred from lambda return type.
  • Formatter handles formatter:off and formatter:on directives in comments.