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: Wrongly received json information of other nvim plugins #55892

Closed
jinzhongjia opened this issue Sep 27, 2022 · 3 comments
Closed
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@jinzhongjia
Copy link

gopls version

golang.org/x/tools/gopls v0.9.5
golang.org/x/tools/gopls@(devel)

go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jin/.cache/go-build"
GOENV="/home/jin/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/jin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jin/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.com.cn,direct"
GOROOT="/nix/store/wd9bwh6552vvn00q99wj7qnh2gn5ndy4-go-1.18.5/share/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/nix/store/wd9bwh6552vvn00q99wj7qnh2gn5ndy4-go-1.18.5/share/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build922577669=/tmp/go-build -gno-record-gcc-switches"

What did you do?

i just use the neovim plugin gitsigns.nvim , and use :lua vim.lsp.buf.code_action(),and Option to trigger gitsigns
image

It looks like gopls tries to recognize the json sent to gitsigns, but my gitsigns is working fine

There is only such a line of errors, there are no other errors in nvim's lsplog

At present, the operation is normal, but this happens when the function triggered by the code action of gitsigns is used.

Editor and settings

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by nixbld

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/jnfqzl7lzqshbqfm9mkl27024nsbcgvz-neovim-unwrapped-0.7.2/share/nvim
"
@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 Sep 27, 2022
@gopherbot gopherbot added this to the Unreleased milestone Sep 27, 2022
@findleyr
Copy link
Contributor

Hi, it looks like you're sending a message that gopls can't unmarshal.

I don't know how gitsigns works, but if it is injecting content that gopls can't recognize, you'll need to provide a sample of that content (in the form of LSP logs) so we can see whether gopls is doing something wrong. Generally, gopls should be able to communicate with any LSP client, so I suspect that the stream may be corrupted.

It looks like gopls tries to recognize the json sent to gitsigns, but my gitsigns is working fine

That's not really how LSP works. In general, the client starts up the language server and communicates over stdin/stdout. If gopls is seeing content on its stdin, something must be putting it there.

@jinzhongjia
Copy link
Author

yeah ,i mean the client send the json to both gopls and gitsigns, I'll try to get the lsp log later

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 28, 2022
@jinzhongjia
Copy link
Author

I have found what is causing this problem,The lspsaga plugin I use will send all the json after replacing the original code action

@golang golang locked and limited conversation to collaborators Sep 30, 2023
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants