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: missing import error is broken on Windows #46805

Closed
findleyr opened this issue Jun 17, 2021 · 1 comment
Closed

x/tools/gopls: missing import error is broken on Windows #46805

findleyr opened this issue Jun 17, 2021 · 1 comment
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.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Jun 17, 2021

While trying to help a user in slack, I noticed that gopls' error for missing imports is broken / misleading, particularly on Windows.

  • It assumes that GOPATH is ':'-separated, when on windows it is ';'-separated.
  • It assumes GOPATH mode (i.e. appending /src)

So if GOPATH="C:\go", we get cannot find foo in any of ... C/src/foo, go/src/foo"

EDIT: we actually do have handling for module mode; the user had opened a non-module parent directory and so gopls assumed GOPATH mode.

The point about Windows still applies though.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jun 17, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jun 17, 2021
@findleyr findleyr changed the title x/tools/gopls: missing import error is broken on Windows or using modules x/tools/gopls: missing import error is broken on Windows Jun 17, 2021
@gopherbot
Copy link

Change https://golang.org/cl/328969 mentions this issue: internal/lsp/cache: fix missing pkg error on windows

@hyangah hyangah modified the milestones: Unreleased, gopls/v0.7.1 Jun 18, 2021
@golang golang locked and limited conversation to collaborators Jun 25, 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.
Projects
None yet
Development

No branches or pull requests

3 participants