Open
Description
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
- Run
go version
to get version of Go from the VS Code integrated terminal.- go version go1.19.1 windows/amd64
- Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.- golang.org/x/tools/gopls v0.12.4
- Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.- 1.80.1
- Check your installed extensions to get the version of the VS Code Go extension
- v0.39.0
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.- GOROOT: C:\Program Files\Go
Share the Go related settings you have added/edited
Run Preferences: Open Settings (JSON)
command to open your settings.json file.
Share all the settings with the go.
or ["go"]
or gopls
prefixes.
{
"go.formatTool": "gofmt",
"[go]": {
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.defaultFormatter": "golang.go"
},
"go.toolsManagement.autoUpdate": true,
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.go$",
"cmd": "golines ${file} -w --base-formatter gofmt -m 80 -t 2"
}
]
}
}
Describe the bug
A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.
When I'm debugging, if I hover over a struct field in my code I expect to see its value (if it has something, of course).
If I've written the dot notation expression in one line, the popup shows the value (OK).
If I've written it in multiple lines, the popup shows the field description (bug).
Steps to reproduce the behavior:
- Debug this code with a breakpoint in the 2nd print.
package main
import "fmt"
type StructA struct {
StructB StructB
}
type StructB struct {
C int
}
func main() {
s := StructA{
StructB: StructB{
C: 1,
},
}
fmt.Println(s.StructB.C)
fmt.Println(s.
StructB.C)
}
- Hover on StructB at the 1st print. You'll see the value. (OK)
- Hover on StructB at the 2nd print. You'll see the description. (bug)
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.