You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check your installed extensions to get the version of the VS Code Go extension
v0.39.1
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
Checking configured tools....
GOBIN: undefined
toolsGopath:
gopath: /home/igor/go
GOROOT: /usr/local/go
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/usr/local/go/bin:/home/igor/go/bin:/usr/local/go/bin:/home/igor/go/bin
go: /usr/local/go/bin/go: go version go1.21.0 linux/amd64
gotests: not installed
gomodifytags: not installed
impl: not installed
goplay: not installed
dlv: /home/igor/go/bin/dlv (version: v1.21.0 built with go: go1.21.0)
staticcheck: /home/igor/go/bin/staticcheck (version: v0.4.5 built with go: go1.21.0)
gopls: /home/igor/go/bin/gopls (version: v0.13.2 built with go: go1.21.0)
go env
Workspace Folder (no folder): undefined
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/igor/.cache/go-build'
GOENV='/home/igor/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/igor/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/igor/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4286429659=/tmp/go-build -gno-record-gcc-switches'
Share the Go related settings you have added/edited
User settings.json doesn't have any go settings.
Describe the bug
VSCode has an option editor.suggest.insertMode that defines behavior on accepting autocompletion suggestion. I have default "insert" setting: "Insert suggestion without overwriting text right of the cursor". When editing .go file and accepting a function name from other package this option is ignored and the text after the cursor is always owerwritten. For example:
func main() {
str := "test"
// Put cursor before str and type "fmt.Sprintf" then accept suggestion.
// "str" is always overwritten, despite editor.suggest.insertMode value
fmt.Printf("s: %v\n", str)
}
I'm attaching a video of how it happens. I reproduced it on the freshly installed Ubuntu 22.04 with freshly installed VSCode and only Go extension installed. The bug happens only when autocompleting function name from other packages (like in example before). If the name before the dot is a name of variable the bug doesn't happen and the text isn't replaced.
I expect the editor.suggest.insertMode: insert option is to be respected and my text is never overwritten by autocompletion.
Screenshots or recordings
Screencast.from.29.08.2023.00.48.47.webm
The text was updated successfully, but these errors were encountered:
Can we reopen this now that golang/go#61215 has been fixed, to track vscode-go incorporating those changes? I assume there's a package upgrade or something needed to actually get VSCode to comply with the setting, since its still ignoring my insert setting.
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
User settings.json doesn't have any go settings.
Describe the bug
VSCode has an option
editor.suggest.insertMode
that defines behavior on accepting autocompletion suggestion. I have default "insert" setting: "Insert suggestion without overwriting text right of the cursor". When editing .go file and accepting a function name from other package this option is ignored and the text after the cursor is always owerwritten. For example:I'm attaching a video of how it happens. I reproduced it on the freshly installed Ubuntu 22.04 with freshly installed VSCode and only Go extension installed. The bug happens only when autocompleting function name from other packages (like in example before). If the name before the dot is a name of variable the bug doesn't happen and the text isn't replaced.
I expect the
editor.suggest.insertMode: insert
option is to be respected and my text is never overwritten by autocompletion.Screenshots or recordings
Screencast.from.29.08.2023.00.48.47.webm
The text was updated successfully, but these errors were encountered: