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: errors while trying to write a struct literal #37259

Closed
urandom opened this issue Feb 17, 2020 · 4 comments
Closed

x/tools/gopls: errors while trying to write a struct literal #37259

urandom opened this issue Feb 17, 2020 · 4 comments
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

@urandom
Copy link

urandom commented Feb 17, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13.6 darwin/amd64
$ gopls version
golang.org/x/tools/gopls v0.3.2
    golang.org/x/tools/gopls@v0.3.2 h1:eP1aj1AvT6ynElQH6KP0mmOT2gnWa1gYclHL4wGUbMo=

What operating system and processor architecture are you using (go env)?

Happens on both linux and macosx

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/viktor.kojouharov/Library/Caches/go-build"
GOENV="/Users/viktor.kojouharov/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/viktor.kojouharov/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.6/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
GOMOD="/Users/viktor.kojouharov/projects/feature-toggles/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ky/99mqlqrd2rd46chcz3tqmxkw0000gn/T/go-build162991808=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

While I'm writing the fields and values of a struct in neovim 0.5.0 using the built-in lsp facilities, I get interruptions and the following messages:

{name:CURSOR}

LSP[gopls] 2020/02/17 09:01:01 failed to fix AST: unable to parse defer or go from *ast.BadStmt: no defer or go statement found

What did you expect to see?

Nothing.

What did you see instead?

failed to fix AST: unable to parse defer or go from *ast.BadStmt: no defer or go statement found

@gopherbot gopherbot added this to the Unreleased milestone Feb 17, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 17, 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.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Feb 17, 2020
@urandom
Copy link
Author

urandom commented Feb 17, 2020

Followup, it seems that this error is being shown after a while. On initial server start, there are no problems. And it doesn't just occur when writing structs, but also various other kinds of statements

@stamblerre
Copy link
Contributor

This is an error that appears in the gopls logs, and it's not part of the diagnostics that should be published to the user. I think that this may be a bug in neovim LSP client, and I would recommend moving this issue to that repository.

@stamblerre
Copy link
Contributor

Thanks! Closing in favor of the upstream issue.

@golang golang locked and limited conversation to collaborators Feb 18, 2021
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