-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
Gopackagesdriver: tell language server to fall back when bazel query fails #3334
Comments
That sounds very reasonable. Given that you already have a PoC, do you want to turn it into a PR? |
ian-h-chamberlain
added a commit
to ian-h-chamberlain/rules_go
that referenced
this issue
Oct 31, 2022
Fixes bazel-contrib#3334 by telling gopls to fallback if the gopackagesdriver can't `bazel query` about the requested file.
ian-h-chamberlain
added a commit
to ian-h-chamberlain/rules_go
that referenced
this issue
Oct 31, 2022
Fixes bazel-contrib#3334 by telling gopls to fallback if the gopackagesdriver can't `bazel query` about the requested file.
ian-h-chamberlain
added a commit
to ian-h-chamberlain/rules_go
that referenced
this issue
Oct 31, 2022
Fixes bazel-contrib#3334 by telling gopls to fallback if the gopackagesdriver can't `bazel query` about the requested file.
linzhp
pushed a commit
that referenced
this issue
Oct 31, 2022
Fixes #3334 by telling gopls to fallback if the gopackagesdriver can't `bazel query` about the requested file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of rules_go are you using?
0.35.0
What version of gazelle are you using?
N/A
What version of Bazel are you using?
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
macOS 12.6, x86_64
Any other potentially useful information about your toolchain?
Using GOPACKAGESDRIVER with
What did you do?
Set up a simple
rules_go
repo and add a file not yet tracked by Bazel (untracked-file
branch)https://github.com/ian-h-chamberlain/gopackagesdriver-repro/tree/untracked-file
What did you expect to see?
I don't necessarily expect completions, etc. to work on the new file, but I also don't expect completion to block for a very long time. In this particular case,
xyz.go
is not part of any Bazel target, but the defaultgopls
packageList
implementation can handle it and provide completions wheregopackagesdriver
cannot.What did you see instead?
Asking for completions takes quite a long time and never actually works correctly in
xyz.go
.I believe this happens because
gopackagesdriver
responds to the language server that it can handle queries about the file, even thoughbazel query
has errors:I believe that simply by responding with
"NotHandled":true
whenbazel query
fails, the language server will fallback to its default implementation and completion, etc. will work mostly correctly.The
main
branch includes a proof-of-conceptgopackagesdriver.sh
that responds this way for any file withxyz
in the name:https://github.com/ian-h-chamberlain/gopackagesdriver-repro/tree/main
Hopefully this is an easy fix that will make things work nicer when a file isn't yet included in Bazel rules so that
gopls
can fall back to its default behavior!The text was updated successfully, but these errors were encountered: