-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.help wanted
Milestone
Description
What version are you using?
~$ go version -m $(which gopls)
/usr/local/google/home/bcmills/bin/gopls: devel +186f0220d0 Mon Oct 5 11:12:24 2020 -0400
path golang.org/x/tools/gopls
mod golang.org/x/tools/gopls v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=
dep github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
dep github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
dep github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
dep golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
dep golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
dep golang.org/x/tools v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=
dep golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
dep honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
dep mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=
dep mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
Does this issue reproduce with the latest release?
Yes
What did you do?
(https://play.golang.org/p/OSPW1IIzNCs)
- Using
emacs
withgopls
viaeglot
, start with a program with an existing undeclared identifier used in several places.
(For this example,errNo
.) - Add a declaration for a new identifier in local scope, but choose a better name for it (
errno
). - Remember that you also need to rename the existing uses of that identifier.
- Place the point at an occurrence of the old identifier and execute
M-x eglot-rename
. - Type in the name of the identifier from step (2).
What did you expect to see?
References to the (now-undeclared) variable at the point should be renamed so that they now refer to the identifier in step (2).
What did you see instead?
gopls
returns a no object found
error.
As reported by M-x eglot-events-buffer
:
[client-request] (id:9) Wed Oct 7 14:42:34 2020:
(:jsonrpc "2.0" :id 9 :method "textDocument/rename" :params
(:textDocument
(:uri "file:///tmp/tmp.Ih8P4GysfM/example.com/main.go")
:position
(:line 13 :character 23)
:newName "errno"))
[server-reply] (id:9) ERROR Wed Oct 7 14:42:34 2020:
(:jsonrpc "2.0" :error
(:code 0 :message "no object found for \"errNo\": no object found")
:id 9)
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.help wanted