Phpactor 2023.01.21

Last modified 2024/12/07 11:48

I have tagged Phpactor 2023.01.21.

This release is a little bit later than normal as I completely forgot to do it last week.

Features

Param docblock generation

If there are any complex trivial types (e.g. generic types, or arrays) Phpactor will now suggest to generate default @param docblocks.

class-string template param

In addition the docblock updating code has been improved allowing us to update docblocks (previosuly Phpactor would only create them).

Support for integer ranges

Phpactor will understand integer ranges, e.g. @param int<0, 10> $zeroToTen. It won’t do anything with the integer range information however, it will just be treated as a basic int type.

Fixes and Improvements

Bug fixes:

  • Allow class completion within constant declaration in class #1985 @przepompownia
  • Do not suggest return type on __destruct #1992
  • Do not report Prophecy methods as “not found” #2006
  • Do not add NULL to type list (fixes search bug) #2009
  • Create a real package for the tolerant-parser fork and use it #2033
  • Also highlight use statements when hovering on class #2039 @mamazu
  • Fix priotity of “internal” stub locator - facilitating enum completion #2040
  • Require posix extension #2042 @dacianb
  • Fix evaluation of replacement assignments #1705
  • Fix crash on missing token in Indexer #2049 @vlada-dudr
  • Fix missing compact use name false positive #2052
  • Fix class-template<T> when not in 1st arg position #2054

Improvements:

  • Support the Psalm cache #2046 @gbprod
  • Support completion inside match expression #2051 @przepompownia
  • Fixed typos in documentation #2050 @d-danilov
  • Psalm Extension: allow info diagnostics to be hidden #2032 @gbprod
  • Better docblock parsing and formatting #2004
  • More liberal support for vendor tags #2011 @ging-dev
  • Fix nested template type arguments #2016
  • Fix importing of nested types #2009
  • Reverts #1974 - which made the situation worse rather than better.
  • Change default WR cache TTL from 5 seconds to 1 second to avoid race with diagnostics timeout.
  • Add return tags to existing docblocks #1995
  • Naive support for attribute completion #2001 @przepompownia
  • Support union type from class-string variadic generic

Musings

This month saw multiple contributions from several people. Since the previous release ~40 days ago I have worked on Phpactor for approximately 25 hours.

I started to look at better PHPUnit support (this release actually reintroduced the PHPUnit extension, but it’s not working great currently). I hope to add code actions to introduce setUp, tearDown and for generating new test methods with or without @dataProvider.

Phpactor isn’t winning prizes for being the fastest Language Server on the planet, in fact it’s a long way from being able to do that. I’m hoping to attempt to improve the static analysis engine and/or to offload realtime diagnostics into a separate process.