Hi everyone,
I've been using gopls through YouCompleteMe and it works.... fine-ish.
The main problem is that I we have an internal repo where we build everything through bazel and we have vendored in dependencies (so go doesn't downloads anything). GOPATH is not really usable because we use bazel for finding packages.
A common structure would be like this
/root
/tools
/pkg_a
some_file.go
/build
/pkg_b
other_file.go
/third_party
/org_golang_google_protobuf/....
....
For our code, we follow the import paths from our repo root. So for the packages in the example, the import paths would be:
For third_party stuff, we use bazel local_repositories, so the import path is what you'd obtain from github or other repo. Using the BUILD files we get the go compiler to find stuff.
The problem is that I have not been able to get gopls to recognize this situation and correctly find the packages. I have delved into the gopls source and am starting to get a feel about how package resolution works, albeit is a slow process. I'm willing to make contributions to both gopls and YouCompleteMe, but I could really use some guidance about where to look, as I feel that even my conceptual understanding of the problem might be wrong.
Would someone be willing to point me in the right direction. I'm happy to have a VC to discuss if you feel it might be faster.
Thank you very much for reading.
Best,