Closed c3n21 closed 1 year ago
Hmm are you using the WSL extension in VSCode or are you using another way of opening the WSL folder? As far as I know, when using WSL in VSCode the file paths are all relative to the WSL root and don't use windows-style paths (such as \\wsl.localhost\WorkArch
). When you open a terminal in your repo and run pwd
what do you get?
You were right I wasn't running VSCode in the "correct way"; I had to navigate to the path inside WSL and there I had to code .
.
But still it errors out with this
[check:1] PHPStan process exited with error err= Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-(
and I need to check PHPStan Language Server to know the errors diagnosed by PHPStan. Is this the way it is supposed to work or it should integrate with VSCode's diagnostics?
It should work if you get rid of that error. I'm pretty sure it's caused by XDebug starting when it shouldn't (more info about how to fix it here). To debug it you can just try running PHPStan outside of the extension and you should run into the same error (the error isn't related to the PHPStan VSCode extension).
After this it should no longer exit with an error and exit successfully and the errors diagnosed should be integrated into VSCode's diagnostics.
I don't know why it throws that error but I managed to work it around.
For PHP development I'm using DDEV which is basically a wrapper around docker-compose that helps you manage PHP environments and has its own way to run xdebug.
What I had to do was to attach to the webserver container inside VSCode
and now it works like a charm.
By the way, since this doesn't seem a fatal error, could you provide a way to ignore this error in the extensions' settings?
Great to hear that it's working!
It's surprisingly hard to ignore PHPStan errors. Since you can't rely on the exit code to find out whether it exited with an error, you have to look at whether stderr was set. I could then filter out any error that contains this xdebug string but I'm sure that won't work on systems with different languages or different xdebug settings (for example in this case it's using "Step Debug", another config might not). I'll definitely keep this in mind though, and if it happens more often I'll consider adding such a feature. For now I'll hold off on adding it.
(I'll close the issue since I think your problem has been resolved)
FYI I've implemented something close to what you suggested in the latest release. Instead of ignoring xdebug stuff, there's a new setting (phpstan.ignoreErrors
) where you can put to-be-ignored errors.
Hello,
when trying to run this extension inside a WSL container it gives me this error:
Settings are the default ones.
Any tips to make this work inside WSL?