Skip to content
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: issue importing standard package in vscode #44616

Closed
sickmon opened this issue Feb 25, 2021 · 4 comments
Closed

x/tools/gopls: issue importing standard package in vscode #44616

sickmon opened this issue Feb 25, 2021 · 4 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@sickmon
Copy link

sickmon commented Feb 25, 2021

Hello,

While writing code in VSCode, if I use a new package, that same is getting added to import package list as expected. But the newly visible package in import gives below error and then automatic suggestion for the package used somewhere else will also not show anything. Only solution is to close vscode gui and open again. I have also enabled experimental features but no luck.
..
could not import fmt (no required module provides package "fmt")compiler
..

Please let me know if it is a bug or another issue. Also, if any other information is needed.
gopls

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Feb 25, 2021
@stamblerre
Copy link
Contributor

Can you please share your gopls logs? Information on how to capture them can be found here.

@stamblerre stamblerre changed the title gopls having issue importing standard package in vscode x/tools/gopls: issue importing standard package in vscode Feb 25, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 25, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 25, 2021
@sickmon
Copy link
Author

sickmon commented Feb 26, 2021

Logs Attached. Please let me know if you need something else.
44616_logs.txt

@hyangah
Copy link
Contributor

hyangah commented Feb 26, 2021

Thanks, but we wanted to have the gopls log described in the Collect gopls information section.

From what you've shared I see that you are currently working in GOPATH mode with multiple directories in GOPATH (/home/vagrant/golib:/home/vagrant/code).

Is the project directory under /home/vagrants/code/src and you opened the vscode from the /home/vagrants/code directory?
And, if possible I strongly recommend updating the go to 1.16.
1.15.1 is pretty outdated and lacks important security fixes.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 26, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Feb 26, 2021
@sickmon
Copy link
Author

sickmon commented Feb 26, 2021

Hi ,

thanks for your suggestion. I updated go to 1.16 and its working as expected.

Thank you again.

@sickmon sickmon closed this as completed Feb 26, 2021
@stamblerre stamblerre removed this from the gopls/v1.0.0 milestone Feb 27, 2021
@golang golang locked and limited conversation to collaborators Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants