-
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: no package found for [...] #32667
Comments
This hapends after a while of usage (~2min), i've made sure that i'm running the latest version of gopls. |
I'm having a similar issue (my project is using modules):
|
I'm using modules, and have a valid go.mod file in my dir |
I'm facing the same issue here. I'm using Go1.12.6 with a valid go.mod in the root directory of the project |
I'm also using modules. I keep my module projects outside my GOPATH since I couldn't get modules to work properly when mixed. Another problem is that the |
@Asarew Is the file you get the “no AST for” error for reside behind a build tag? |
Noo, the file or package doesn't contain any build tags. |
I don't have any build tags either. |
i didn't had any problems all morning, until i started to run some tests (basic |
When i was trying to find a fix for this issue i found a long standing bug that resulted in the same error #31553. But i'm not making any changes to the directory outside of vs-code. Does a |
I have the same issue in a project where Go part is in the subfolder. Simplified structure is:
|
I don't have the same setup as @jBugman, my |
I'm seeing this in a module context. In my situation, there are a number of relatively rapid changes to certain files (a code generator is the source of the changes, but the changes are notified to I first see a number of lines like:
I also see a number of lines like:
Then I see a number of lines like:
I also see a number of lines like:
I don't yet have a repro for this. What version of Go are you using (
|
FWIW this was also an issue with:
|
same problem with @Asarew |
same here... tried to downgrade go to 1.11.11 and recreate my GOPATH... the issue still happens. |
@Asarew: Running the @blixt: Based on your @hbobenicio: Updating the VSCode-Go extension should not be necessary, but you can get the latest version of Just to reiterate, if you are using |
@stamblerre Only opening the folder with the Go code does seem to work better, but I can't really work like that in my setup so I'll turn off use of the language server. I'm a bit surprised that this is a known limitation but there are no error messages implying what the problem is and |
@blixt: You can use File -> Add Folder to Workspace to create a workspace with multiple folders, and this will work fine with |
@stamblerre I've done absolutely nothing but I'm unable to trigger the same error this morning. I'll keep on working with my current configuration this week. If nothing happens I'll assume the cause of the error as a PEBCAK and close the issue. |
I have a setup similar to #32667 (comment), that is go.mod isn't at the project root. I can confirm that both 'workarounds' suggested by @stamblerre work
Although it works, hopefully the root cause(s) get solved |
Please keep the issue open, even if you're not able to reproduce it. I have reproduction steps (it's somewhat timing related) and have privately shared logs with @stamblerre and @ianthehat |
I am observing this issue upon starting VS Code in a GOPATH based project (not use modules), on a
On commit This is also paired with an error message
EDIT: moved to a separate issue #32812 |
In my case the problem after all was that my GOPATH was messed up. Following this tip I just removed my GOPATH (in my case it was the default |
What version of Go are you using (
go version
)?Does 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?
goto definition
What did you expect to see?
Goto the definition
What did you see instead?
The text was updated successfully, but these errors were encountered: