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: only show outside of GOPATH/modules warning once #37279

Closed
stamblerre opened this issue Feb 18, 2020 · 5 comments
Closed

x/tools/gopls: only show outside of GOPATH/modules warning once #37279

stamblerre opened this issue Feb 18, 2020 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@stamblerre
Copy link
Contributor

See microsoft/vscode-go#3055.

@stamblerre stamblerre added this to the gopls/v0.4.0 milestone Feb 18, 2020
@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 Feb 18, 2020
@stamblerre stamblerre added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 26, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.4.0, gopls/v0.5.0 Apr 2, 2020
@stamblerre
Copy link
Contributor Author

I think the correct fix for this would be to show the warning only once, on view creation, instead of on diagnostics.

@myitcv
Copy link
Member

myitcv commented Apr 24, 2020

What about only showing the warning if the user actively tries to do something via gopls?

i.e. the initial attempt to pre-load the workspace can fail, it only becomes relevant if the user actually does something within that workspace, i.e. open a .go file.

@stamblerre
Copy link
Contributor Author

Right now, we only show the warning if the user is working outside of GOPATH/modules and has a dependency we cannot resolve. This has been an acceptable approximation of "something went wrong and here's a hint", but it can cause the warning to pop up when the user is just typing an import manually. I think showing it once only if we see errors in the package (caused by dependencies) is probably the best fix because we don't want to bother the user unnecessarily (and opening an ad-hoc package is not necessarily wrong).

@pjweinb
Copy link

pjweinb commented Apr 29, 2020

If the workspace outside GOPATH/modules we show this message a lot if the user has code with diagnostics. I think it would be better only to show it if it's the inital load or the user is changing configuration (and there are other errors). I have a CL.

@gopherbot
Copy link

Change https://golang.org/cl/230897 mentions this issue: internal/lsp: avoid showing no-GOPATH-nor-module message so much

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. NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants