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: VS Code extension showing warning in Terratest #38590

Closed
dariagrudzien opened this issue Apr 22, 2020 · 3 comments
Closed

x/tools/gopls: VS Code extension showing warning in Terratest #38590

dariagrudzien opened this issue Apr 22, 2020 · 3 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.
Milestone

Comments

@dariagrudzien
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.13

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOHOSTARCH="amd64"
GOHOSTOS="darwin"

What Go VS Code extension are you using

0.14.0

What did you do?

I am working on Terratest, and therefore my directory looks more or less like this:

./terraform
./terraform/output.tf
./terraform/main.tf
./terraform/test
./terraform/test/go.mod
./terraform/test/main_unit_test.go
./terraform/test/go.sum
./terraform/Makefile
./terraform/variables.tf
./terraform/provider.tf

I have VS Code open at the terraform directory level, I am working in the main_unit_test.go file.

What did you see?

A warning: You are neither in a module nor in your GOPATH. If you are using modules, please open your editor at the directory containing the go.mod.

What did you expect to see?

Go extension in VS Code working properly. My go.mod file is buried in a subdirectory, but I'm not able to open VS Code in that directory - I need to see the files I'm working on outside of the test directory. I wish there was a way to configure the extension to look for go.mod somewhere else.

@andybons andybons changed the title VS Code extension showing warning in Terratest x/tools/gopls: VS Code extension showing warning in Terratest Apr 22, 2020
@gopherbot gopherbot added this to the Unreleased milestone Apr 22, 2020
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 22, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Apr 22, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Apr 22, 2020
@stamblerre
Copy link
Contributor

stamblerre commented Apr 22, 2020

Go extension in VS Code working properly. My go.mod file is buried in a subdirectory, but I'm not able to open VS Code in that directory - I need to see the files I'm working on outside of the test directory. I wish there was a way to configure the extension to look for go.mod somewhere else.

You can add the directory to your workspace through File > Add Folder to Workspace. I recognize this is not the ideal workflow, as you will see the directory in two places in the outline on the left-hand side, but it should resolve the issue. We're working on improving this for gopls/v0.6.0.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Apr 22, 2020
@stamblerre stamblerre added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 24, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.2 Jun 18, 2020
@golang golang locked and limited conversation to collaborators Jun 18, 2021
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