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: "method textDocument/completion did not reply" #37859

Closed
foxcpp opened this issue Mar 14, 2020 · 5 comments
Closed

x/tools/gopls: "method textDocument/completion did not reply" #37859

foxcpp opened this issue Mar 14, 2020 · 5 comments
Labels
Documentation 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

@foxcpp
Copy link

foxcpp commented Mar 14, 2020

What did you do?

  1. Use gopls with LanguageClient-neovim.
  2. Open the file with the following contents:
package main

import "net"

type S struct {
	F int
}

func main() {
	s := S{}

}
  1. Place the cursor on the empty line in main and type s.F, a = net,
  2. LanguageClient-neovim triggers completion to show net contents.
  • The issue is not specific to the net package, but does not affect all packages. errors works correctly. net, os and github.com/wireguard/wgctrl-go do not.
  • I do not know whether the issue is specific to the LanguageClient-neovim behavior or not.
  • If the package is not imported and completeUnimported is enabled, completion is shown correctly.

What did you expect to see?

Completion popup with things exported by net .

What did you see instead?

gopls exits, no completion is shown. LanguageClient-neovim prints the following messages:

[LC] Error: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "method \"textDocument/completion\" did not reply", data: N
one }, id: Num(3) }
[LC] sending on a disconnected channel
[LC] sending on a disconnected channel

Last two are likely related to the gopls process exiting.

Build info

golang.org/x/tools/gopls v0.3.3
    golang.org/x/tools/gopls@v0.3.3 h1:mTFqRDJQmpSsgDDWvbtGnSva1z9uX2XcDszSWa6DhBQ=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20200227200655-6862ededa516 h1:OX66ZzpltgCOuBSGdaeT77hS2z3ub2AB+EuGxvGRBLE=
    golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/tools@v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
    mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.14 linux/amd64

GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/foxcpp/.go/bin"
GOCACHE="/home/foxcpp/.cache/go-build"
GOENV="/home/foxcpp/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/foxcpp/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/foxcpp/gopls-bug/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build364981597=/tmp/go-build -gno-record-gcc-switches"
@gopherbot gopherbot added this to the Unreleased milestone Mar 14, 2020
@gopherbot gopherbot added Documentation Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 14, 2020
@gopherbot
Copy link

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.

@foxcpp
Copy link
Author

foxcpp commented Mar 14, 2020

gopls.txt

gopls log with -rpc.trace. Also uploaded to https://hastebin.com/herurufoma for viewing convenience.

@muirdm
Copy link

muirdm commented Mar 16, 2020

Should be fixed by https://go-review.googlesource.com/c/tools/+/221020. The fix will be included in the next release. You can install from master in the meantime if you are hitting it a lot (it is triggered by the undeclared "a" identifier in the assignment.

@foxcpp
Copy link
Author

foxcpp commented Mar 16, 2020

Verified it is fixed at golang.org/x/tools/gopls@v0.1.8-0.20200316182129-bd88ce97550a. Thanks!

@stamblerre
Copy link
Contributor

Thanks for confirming! I'll try to release gopls/v0.3.4 with this fix in the next few days.

@golang golang locked and limited conversation to collaborators Mar 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation 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

4 participants