SanderRonde / phpstan-vscode

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

XDebug breaks the extension #26

Closed MissaelAnda closed 1 year ago

MissaelAnda commented 1 year ago

Apparently the XDebug warning message breaks the extension, always throws error.

image

image

SanderRonde commented 1 year ago

Looks like this is the same one as this issue and the one it references right?

MissaelAnda commented 1 year ago

Yes it is.

SanderRonde commented 1 year ago

Alright it should be fixable through the same methods used in those issues then. Closing this one for now.

hugoburguete commented 1 year ago

I wasn't able to resolve this issue with regex (tbh, im not very good at regex :D) but found an alternative instead so if anyone in the future is experiencing this, you can turn off xdebug by passing the --xdebug flag to phpstan.

So in the extension options -> PHPStan Options -> Add Item -> and add --xdebug should resolve the issue.

You may have to restart VSCode.

MissaelAnda commented 1 year ago

I just added XDebug: .* and ! .* to phpstan.ignoreErrors and it works fine.

jorgemunozc commented 1 year ago

For future people looking at this: --xdebug doesn't turn off xdebug, it turns it on. source: https://phpstan.org/user-guide/command-line-usage#--xdebug

hugoburguete commented 1 year ago

For future people looking at this: --xdebug doesn't turn off xdebug, it turns it on. source: https://phpstan.org/user-guide/command-line-usage#--xdebug

This is correct. I forgot to update my comment above so thanks for doing it for me :)

MissaelAnda's solution looks like the way to go (although I haven't tested it myself)

ljubadr commented 8 months ago

Those notifications can be disabled by changing xdebug.log_level

I always use xdebug.log_level=0 to turn off everything except critical errors