When trying to change the symbols, VSCode throws the following error:
"Rename failed: gorename: can't find package containing /home/hume/projects/go/main.go"
vscode 1.22.2 x64
go version go1.10.1 linux/amd64
go env GOPATH /home/hume/projects/go
My settings.json
is as follows:
{
"go.toolsGopath": "/home/hume/gotools"
, "go.autocompleteUnimportedPackages": true
, "go.inferGopath": true
, "go.formatTool": "gofmt"
, "go.vetFlags": [
"/src"
]
}
Thanks.
You can switch to using gpls, the official Go language server. Besides other featured renaming symbols works perfectly regardless of any package structure.
In VSC open Preferences, Settings, and activate go.useLanguageServer
. After installing gpls you are ready to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With