-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: expensive go list run on startup #35818
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
You're correct in saying that CL 204822 changed the behavior of |
Because otherwise you end up with situations where you run:
in a directory which, in my case, is ~60GB and the command takes 10 minutes and counting. Indeed, if you are outside of a module context or |
I'm running into this as well (also via govim). When I start vim from some random directory (often $HOME) to do non-Go work (perhaps edit a single text file), gopls might run a very expensive |
Does |
Yes. |
I would argue that that's probably the larger issue here. I can't immediately think of an argument for why that would be necessary. |
Yes.
But underneath my (On a related point, I seem to recall only My worry with this sort of logic, "start My understanding is that we will need
(ignoring nested modules for one second, because that's more of a UI/UX problem to my mind) What about when Putting this logic in the client also means we close the door on making Hence why I'm suggesting to sidestep the problem of clients getting this right and implement it in |
In 1.14, if the This probably won't come up much because it requires |
I've just done a test against 0cba7a3 with partial revert of CL 214586 applied on top, in the form of CL 215239. We are still seeing the expensive |
Change https://golang.org/cl/216143 mentions this issue: |
Thanks very much for this fix! |
What version of Go are you using (
go version
)?Note that
github.com/myitcvforks/tools v0.0.0-20191119111301-0222b4b716c6
andgithub.com/myitcvforks/tools/gopls v0.0.0-20191119111301-0222b4b716c6
correspond to thex/tools
95cb2a1 with 80313e1 cherry picked on top. Reason being, we can't move beyond 95cb2a1 because otherwise we start tripping over the mistmatched versions problem described in #35114Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Started
govim
from the$HOME
. This directory is outside of a module (GOMOD=""
) and not within myGOPATH
.What did you expect to see?
No activity from
gopls
What did you see instead?
gopls
running:I suspect (although haven't bisected) this change happened as part of https://go-review.googlesource.com/c/tools/+/204822.
The running of this query should I think at most be limited to either:
GOPATH
GOMOD != ""
Alternatively the client could be responsible for not loading
gopls
(or itself for that matter) unless those conditions are met, but that seems to put too much logic in the client. And also precludes the situation where the user then goes on to create ago.mod
by hand, thereby creating a module context.cc @stamblerre @matloob
The text was updated successfully, but these errors were encountered: