SanderRonde / phpstan-vscode

PHPStan plugin for VSCode
https://marketplace.visualstudio.com/items?itemName=SanderRonde.phpstan-vscode
MIT License
40 stars 9 forks source link

Fix paths not using mapping when scanning project #28

Closed raustin-m closed 1 year ago

raustin-m commented 1 year ago

Fixes #27

Paths were not being mapped when scanning a project the same way they were when scanning a single file. This PR fixes that by adding a method that returns a (synchronous) mapping function, which can then be used to map one or many paths using the same mapping config (retrieved asynchronously).

SanderRonde commented 1 year ago

Looks good! Maybe one thing based on your comment in the other thread is to make it so the getPathMapper function takes a inverse parameter that is true for the project-case. Then you won't need to put the reverse path mapping in the settings. Could you do that part too? Then it's all good.

raustin-m commented 1 year ago

Sure thing, just added that and it seems to work fine with just the one entry in my paths config now.

SanderRonde commented 1 year ago

Awesome, thanks! I'll merge it