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

Comments

@dariagrudzien
Copy link

@dariagrudzien dariagrudzien commented Apr 22, 2020

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
@gopherbot gopherbot added the Tools label Apr 22, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 22, 2020

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 label Apr 22, 2020
@stamblerre
Copy link
Contributor

@stamblerre 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.

@gopherbot
Copy link

@gopherbot gopherbot commented May 24, 2020

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.)

@gopherbot gopherbot closed this May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.