-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP / Psalm installed in docker container #176
Comments
It shouldn't be an issue, if you run composer to install psalm, you should be able to use it as usual through EDIT: sorry, didn't look at the repo name, I thought you were talking about Psalm itself. nevermind! |
Psalm (including the language server) does work in container, however there's currently no support for mapping the paths between host machine and the container. There's a PR in the Psalm repo to address this: vimeo/psalm#8026 |
My team uses docker all day long. We actually execute and run psalm outside of the docker instance (so we use our local php binaries). This works well in our case and has been that way for the last 2 years we've been using psalm. We have about 4-5 developers working this way and don't experience issues. The way the plugin itself works is through STDIO pipes but you can also configure it to connect through TCP however it binds to localhost and is assigned a random port. In TCP Mode vscode starts a language server and then tells Psalm to start with the EG:
With this set inside the docker container itself I am able to ping the host.
This is how we get xdebug breaks to work. Let me know if this is something you'd like as looking at the code it doesn't seem hard to achieve. We'd basically expose the ability to define the port and ip for both the server and the client ahead of time. In the ip for the client you'd set it to |
Hey @tm1000, sorry for the delay. That sounds great though! similar to what https://github.com/plotbox-io/psalm-docker-vscode is doing actually. In working to get the other plugin working in vscode I actually ran into some issues with the container not being able to see the outside, even though I was able to ping it just fine. I think it had to do with the port being randomized, so the ability to set the port would be great. You can actually read a lot about my setup / experience in this issue, if interested. Currently my workflow is that I moved one of the smaller projects I work on locally, so that php exists on the system and I can use this plugin as is. But there are other bigger / older projects with different php versions that I can't easily do this with, so being able to use the containerized php would be awesome. |
There is now: vimeo/psalm#10033 |
I have php / psalm running in a docker container... I've tried various different config options trying to get this plugin to find psalm in that container, but there doesn't seem to be any support for such a workflow... Any ideas / tips? Anybody else have success with something similar?
The text was updated successfully, but these errors were encountered: