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: incorrect casing for multiple JSON fields after latest update of LSP stubs #55099

Closed
fsouza opened this issue Sep 16, 2022 · 3 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

@fsouza
Copy link
Contributor

fsouza commented Sep 16, 2022

gopls version

Build info
----------
golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@(devel)
    github.com/BurntSushi/toml@v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
    github.com/google/go-cmp@v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
    golang.org/x/exp/typeparams@v0.0.0-20220722155223-a9213eeb770e h1:7Xs2YCOpMlNqSQSmrrnhlzBXIE/bpMecZplbLePTJvE=
    golang.org/x/mod@v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
    golang.org/x/sync@v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
    golang.org/x/sys@v0.0.0-20220808155132-1c4a2a72c664 h1:v1W7bwXHsnLLloWYTVEdvGvA7BHMeBYsPcF0GLDxIRs=
    golang.org/x/text@v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
    golang.org/x/tools@v0.1.13-0.20220810174125-0ad49fdeb955 => ../
    golang.org/x/vuln@v0.0.0-20220901221904-62b0186a1058 h1:YnB27EXBD8XxB0JcaOeluuvhF2kS4DrH0k+lpopG2xc=
    honnef.co/go/tools@v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
    mvdan.cc/gofumpt@v0.3.1 h1:avhhrOmv0IuvQVK7fvwV91oFSGAk5/6Po8GXTzICeu8=
    mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: devel go1.20-36760ca9fd Thu Sep 15 21:33:37 2022 +0000

go env

% go env
GO111MODULE=""
GOARCH="arm64"
GOBIN="/Users/fsouza/bin"
GOCACHE="/Users/fsouza/Library/Caches/go-build"
GOENV="/Users/fsouza/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS="-modcacherw"
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/fsouza/.cache/go/path/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/fsouza/.cache/go/path"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/fsouza/.cache/go/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/fsouza/.cache/go/sdk/gotip/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="devel go1.20-36760ca9fd Thu Sep 15 21:33:37 2022 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/fsouza/.cache/nvim/langservers/tools/go.mod"
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rz/8d0l4yp51sd3jh9f34x7pkg80000gn/T/go-build451073517=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Trying to use prepareRename, but it no longer works, because gopls is returning a non-conforming JSON. Here's the response I got:

[DEBUG][2022-09-15 23:03:40] .../vim/lsp/rpc.lua:388    "rpc.receive"   {
  id = 3,
  jsonrpc = "2.0",
  result = {
    Placeholder = "parseLine",
    Range = {
      ["end"] = {
        character = 14,
        line = 86
      },
      start = {
        character = 5,
        line = 86
      }
    }
  }
}

What did you expect to see?

placeholder and range should both be lowercase.

What did you see instead?

Placeholder and Range.

Looking at the diff in the latest stub update, I noticed that other fields changed too: golang/tools@9250e22

Specifically with the prepareRename result, this is what it used to be: https://github.com/golang/tools/blob/ec743893cd01c9423aaae4513b092c4c4c06f0f4/gopls/internal/lsp/protocol/tsprotocol.go#L6443-L6446

Here's what it is now: https://github.com/golang/tools/blob/a61f20e1aa172e30522c65973ead5509cecf01c2/gopls/internal/lsp/protocol/tsprotocol.go#L2829-L2832

Editor and settings

N/A

Logs

N/A

@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 16, 2022
@gopherbot gopherbot added this to the Unreleased milestone Sep 16, 2022
@findleyr
Copy link
Contributor

Thank you very much for reporting. CC @pjweinb

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.10.0 Sep 16, 2022
@pjweinb
Copy link

pjweinb commented Sep 16, 2022 via email

@gopherbot
Copy link

Change https://go.dev/cl/431218 mentions this issue: gopls/tsprotocol: fix json tags and indirect some zero values

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

4 participants