-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: doesn't work on unsaved buffers in module mode #31467
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
Comments
I am only going to speak to gopls as that is the only solution the go team is likely to add features to moving forwards. |
@ianthehat |
Edit: I upgraded from Go 1.12.3 to 1.12.4 and it fixed my issue. Sorry for the noise. Running into the first issue mentioned. Seems specific to Using package main
import "fmt"
import "net"
func main() {
fmt.Println("vim-go")
}
|
Change https://golang.org/cl/172409 mentions this issue: |
@stamblerre - following https://go-review.googlesource.com/c/tools/+/172409/ I'm still seeing an issue in the test in #31338 (was closed in favour of this issue), i.e. completions are not working for unpersisted imports. Should I open another issue for that or ...? |
I tested it and didn't see it fixed. My friend and I are making a new lsp instead of gopls, hope that gopls will become mature enough. |
The issue with this bug is it's difficult to reverse engineer the package path given the filename and the package declaration. #31522 is tracking further improvements to the overlays in @myitcv: I expect that if you try the same case with a non-main file it should work. Filed #31542. |
Closing this issue in favor of #31542. |
@stamblerre #31542 is closed. but i dont find the problem solved. gopls also doesnt work on unsaved buffer when i import a new thirty package. |
It's possible that there has been a recent regression. I will reopen this issue and investigate. Thanks for pointing this out. |
It seems like this is actually an issue with |
@stamblerre hi, i found the #33482 is closed.but i found this issue still exist. I believe that many developers import many third-party packages in their daily work, but gopls can't work in this kind of scenario. I have discussed this problem with my colleagues, we are bothered by this, every time I import a thirty package ,I need to save and restart vim or emacs . I would like to know the go team's view on this issue. This problem has been around for a long time. At least I created this issue last year. |
@taigacute: I am not able to reproduce this issue myself. We have added a lot of overlay support to go/packages, so almost everything should work out of the box. Which client are you using for Vim or Emacs? Is the third-party package that you are importing in your module cache? |
@stamblerre gif is vim,also i use emacs。reproduce step。
what i missed ? |
Sorry, by client I meant - which plugin are you using for the LSP? Is this with |
@stamblerre i used coc.nvim .yeah the package in my |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am a vimer and gopher. Since gocode removed the autobuild feature, I switched to lsp and coc.nvim. At first I used go-langserver, which worked fine, but it was slow and high CPU usage. I tried the functions of bingo and gopls, bingo and gopls are problematic. The problem is always there and I didn't see it being fixed. problem with gopls
problem 1 GOPATH Project:
this file in $GOPATH/src/test/main.go,I can't get any completion information when i input these。
save the file and reopen file gopls works。
problem 2 Go mod Project:
When I introduce a third party package, I can't get any completion information.
What did you expect to see?
Completion of normal work
What did you see instead?
go -langserver. but its performance is terrible
The text was updated successfully, but these errors were encountered: