Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: off by one error in name function rename #39364
What version of Go, VS Code & VS Code Go extension are you using?
Describe the bug
When changing a function name which is preceded by a multiline /* */ style doc comment, the name change makes two mistakes.
Maybe it is somehow related to two char Windows end of line CR/LF.
Steps to reproduce the behavior:
Add this code to a .go file:
Now place your cursor in the function name Test() and press F2 to change the name. Type the new name Gronk. The result will be:
@WBare Can you please share your go related settings? (those starting with
If you are using the language server (
Ok. Here are the settings:
And here is the View->Output -> gopls
[Info - 1:35:01 PM] 2020/06/02 13:35:01 Build info
go version go1.14.3 windows/amd64
[Info - 1:35:02 PM] 2020/06/02 13:35:02 go env for D:\GoDev\neuroics.com
[Info - 1:35:02 PM] 2020/06/02 13:35:02 go/packages.Load
[Info - 1:35:33 PM] 2020/06/02 13:35:33 background imports cache refresh starting
[Info - 1:35:33 PM] 2020/06/02 13:35:33 background refresh finished after 302.2648ms