SanderRonde / phpstan-vscode

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

Extension not working due to a warning #19

Closed YoungMind1 closed 1 year ago

YoungMind1 commented 1 year ago

From PHPStan 1.9, PHPStan emits a warning regarding the use Xdebug extension. This breaks the extension.

Note: The message might change in future.

I tried to filter out the lines of phpstan output by !l.startsWith('!'), but it didn't work.

SanderRonde commented 1 year ago

Is this the same issue as #17 ? There should a fix for it available.

YoungMind1 commented 1 year ago

Yeap it is fixed now. thank you. The sad part is that the Xdebug note is not just one line. For some reason it breaks the warning into 3 lines. So I had to ignore These: ".*The Xdebug PHP extension is active.*", ".*slow down performance.*", ".*breakpoints.*"

SanderRonde commented 1 year ago

Ah that sucks. Let's hope the warning can be disabled from the Phpstan side soon

lmichelin commented 1 year ago

Hello, I found a way to fix this issue by creating an executable file named phpstan-without-xdebug in the bin folder of my symfony app and containing the following line:

#!/bin/sh

XDEBUG_MODE=off vendor/bin/phpstan "$@"

then I added the following line in my settings.json file in VS Code:

"phpstan.binCommand": ["bin/phpstan-without-xdebug"],

Hope this can help...