-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/tools/gopls: document how to run the daemon in docker #41332
Comments
/cc @findleyr |
If you're seeing connection logging from the daemon inside docker, then you are indeed connecting to the daemon and gopls should be forwarding the LSP. What is the nature of your build error? My guess is that this may be related to the fact that the gopls forwarder also forwards Once we figure this out, we should update the env forwarding logic: what you're trying to do seems like a valuable use-case to support. I'll also note that there may be issues using gopls on go1.12. Our support for Go versions older than the last two releases is best-effort, though we do make sure gopls compiles and tests pass (this is a recent addition to our CI). |
BTW, I would expect there to be other problems running the gopls daemon in docker. Namely that the file URIs would be incorrect. However, for darwin->linux it could probably be made to work. I assume you've mounted your workspace at the exact same absolute path. Links to outside your workspace (in |
Thanks for the help! |
Great, thanks for confirming. You've done something I had wanted to experiment with for a while :) Repurposing this issue to track documenting and streamlining this use-case for the daemon. |
What version of Go are you using (
go version
)?go1.12.17 darwin/amd64
Does this issue reproduce with the latest release?
YES recent version of gopls 0.4.4
What operating system and processor architecture are you using (
go env
)?What did you do?
I am trying to setup gopls for neovim with the builtin lsp. But I have a dependency on linux to build the source I cannot build it on mac. So I tried setting up docker gopls server to listen at 7050.
Dockerfile
I opened nvim and it throws the same build error as the one I got on mac.
Neovim config
I initially tried this docker setup for a simple hello world example and that worked. But now I am not sure whether it actually compiled inside docker and communicated the results outside or it just compiled in mac itself.
Gopls listen inside docker doesn't give any logs other than connected and exited (atleast when I run docker logs ).
PS: I execed into docker and built the source and it worked as expected.
What did you expect to see?
I expect gopls -remote to build the source inside docker and give back the results to the client.
What did you see instead?
I see the same build error which I got on mac, which might mean gopls is not forwarding the commands to the remote and doing it locally.
The text was updated successfully, but these errors were encountered: