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: off by one error in name function rename #39364
Comments
@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 infogolang.org/x/tools/gopls 0.4.1 Go infogo 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 |
Thank you! Looks like you're using |
Thanks for the report @WBare. You are right to say that this relates to Windows line endings. I'll take a look at this and see if it's fixable, but in the meantime, we do suggest always using Unix line endings, as |
Change https://golang.org/cl/240757 mentions this issue: |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code InsidersCommit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:35.169Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
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:
The text was updated successfully, but these errors were encountered: