SanderRonde / phpstan-vscode

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

Not getting any errors in vscode #30

Closed shaneparsons closed 1 year ago

shaneparsons commented 1 year ago

I'm not getting any errors in VS Code, even though running the command manually in the container does display errors. The only thing I can see in VS Code that may hint to failure is last operation result = Error in the output (see below).

Output ``` [file-watcher] Document changed, checking [check:41] Check started for file:///home/sparsons/repo/mono/btms/php/src/agentform.php [status-bar] Showing status bar [status-bar] Hiding status bar, last operation result = Error [check:41] Check completed for file:///home/sparsons/repo/mono/btms/php/src/agentform.php errors= {} ```

I've checked in the developer tools and am not seeing any errors there, so I'm finding this hard to debug.

My PHP is running in a container, but I set up the config (see below) per https://github.com/SanderRonde/phpstan-vscode/issues/8, which was working back in the day.

Config ```json "phpstan.binCommand": ["php-btms", "bin/phpstan"], "phpstan.rootDir": "/home/sparsons/repo/mono/btms/php/src", "phpstan.configFile": "", "phpstan.options": ["--xdebug", "--level max"], "phpstan.paths": { "/home/sparsons/repo/mono/btms/php/src": "/var/www/html" }, ```

As mentioned, I am able to see errors when running manually (see below).

Command ``` php-btms bin/phpstan analyse --level max agentform.php ... [ERROR] Found 10 errors ```

I know I have a weird setup here so I'm not expecting you to do a deep dive on this... I'm just wondering if there's perhaps a way to add more detailed logging to shine some more detail on what's failing in last operation result = Error?

Let me know if you need anything else!

shaneparsons commented 1 year ago

Did a deep dive on this, and there were actually a couple of issues. The man issue though, was actually happening because an xdebug error on top of the output was throwing the check off. Fixed by using the phpstan.ignoreErrors config option to remove the xdebug garbage.

SanderRonde commented 1 year ago

Good to hear you fixed this. I'll make the "ran into errors" message a bit more informative.