-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: VS code hangs when working on a project that uses bazel. #48751
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
Comments
The title is probably not the most descriptive. VS Code doesn't become entirely unresponsive (hang). Go functionality just stops and saves don't complete until reloading VS Code. |
Please take a look at https://github.com/golang/tools/tree/master/gopls#supported-go-versions-and-build-systems. Bazel is not fully supported, but you can try setting up the gopackagesdriver as described in the linked instructions. |
FWIW, the project in question works fine as long as I am not simultaneously using bazel tools. That is, the project is structured to be developed like a regular go project that uses I will take a look at the link nonetheless. |
While bazel is running and updating underlying files and symlinks, how can one guarantee the project is in a state that can be treated like a regular go project? I don't know what gopls can do better if other independent tools are modifying the project concurrently in high-speed. Since |
Bazel is not mutating any files outside of the symlinked directories. Occasionally the BUILD files will be updated, but this is infrequent. There is a possibility gopls or some other go tool is traversing the symlinked directories, which I believe would be a bug. |
Please reopen or file a new issue when you have a trace and a minimal repro-case (the linked repo is not publicly accessible fyi). For gopls logging, see https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capture-logs for instruction. |
I will try to capture logs when I have time. The repo linked above should be identical to this one now: |
Gopls's behavior around symlinks is undefined. If you collect trace, please update this issue. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is better.
A failing unit test is the best.
ibazel test //codegen:all
codegen/codegen_imports_test.go
.bazel run //:gazelle
codegen/codegen_imports_test.go
and hit save.Eventually, the save command fails and go-pls stops giving autocomplete suggestions.
What did you expect to see?
I would expect go-pls to remain happy and for save to work.
What did you see instead?
In the
gopls (server)
output:Build info
The text was updated successfully, but these errors were encountered: