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

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 18, 2020

@stamblerre stamblerre added this to the gopls/v0.4.0 milestone Feb 18, 2020
@stamblerre stamblerre added the NeedsFix 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

@stamblerre stamblerre commented Apr 21, 2020

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

@stamblerre stamblerre commented Apr 24, 2020

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

@gopherbot gopherbot commented May 2, 2020

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