Skip to content
This repository has been archived by the owner on Mar 20, 2022. It is now read-only.

New Implementation #14

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open

New Implementation #14

wants to merge 63 commits into from

Conversation

dantleech
Copy link
Contributor

@dantleech dantleech commented Jan 23, 2021

Completely new AST based implementation:

  • Produces reliable AST
  • Captures node byte-offsets (e.g. to faciliate editing)
  • Support parsing generics
  • Feature parity with existing parser

The parser is around ~33% faster than the PHPStan docblock parser (although the benchmark is quite naieve currently):

\Phpactor\Docblock\Tests\Benchmark\PhpstanParserBench

    benchParse..............................I32 250.285 μs (±14.90%)

\Phpactor\Docblock\Tests\Benchmark\PhpactorParserBench

    benchParse..............................I32 185.466 μs (±14.97%)

But still around *3 times slower^ than the existing implementation, it might be possible to reduce this perforamance gap, and I'm not sure what the final performance impact would be.

TODO:

  • Create a test which parses the phpstorm stubs.
  • See if performance can be improved further
  • Support multi-line descriptions

@BladeMF
Copy link

BladeMF commented Jan 23, 2021

Do we get completion within type declarations in the doc block with this?

@dantleech
Copy link
Contributor Author

Do we get completion within type declarations in the doc block with this?

This is just the parser, it just provides information about the docblock.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants