Skip to content

Unable to create a new line #3733

Closed
Closed
@AkashR348

Description

@AkashR348

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.
    • 1.24.1
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • v0.18.1
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.98.2
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.46.1
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

    Tools Configuration

Environment

GOBIN: undefined
toolsGopath:
gopath: C:\Users\akash\go
GOROOT: C:\Program Files\Go
PATH: C:\Program Files\Go\bin;C:\Program Files\Eclipse Adoptium\jdk-21.0.4.7-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python312\Scripts;C:\Python312;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\node.js;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js.lnk;C:\TDM-GCC-64\bin;C:\Program Files\dotnet;C:\Program Files (x86)\Nodist\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\akash.cargo\bin;C:\Users\akash\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\akash\flutter\bin;C:\Users\akash\AppData\Local\Android\Sdk\emulator;C:\node.js;C:\Users\akash\AppData\Local\GitHubDesktop\bin;C:\Users\akash\AppData\Local\Microsoft\WindowsApps;C:\Users\akash\AppData\Local\Programs\Swift\Runtimes\6.0.3\usr\bin;C:\Users\akash\AppData\Local\Programs\Swift\Toolchains\6.0.3+Asserts\usr\bin;C:\Users\akash\AppData\Local\Programs\Swift\Tools\6.0.3;C:\Users\akash\go\bin
PATH (vscode launched with): C:\Program Files\Eclipse Adoptium\jdk-21.0.4.7-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python312\Scripts;C:\Python312;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\node.js;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js.lnk;C:\TDM-GCC-64\bin;C:\Program Files\dotnet;C:\Program Files (x86)\Nodist\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Go\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\akash.cargo\bin;C:\Users\akash\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\akash\flutter\bin;C:\Users\akash\AppData\Local\Android\Sdk\emulator;C:\node.js;C:\Users\akash\AppData\Local\GitHubDesktop\bin;C:\Users\akash\AppData\Local\Microsoft\WindowsApps;C:\Users\akash\AppData\Local\Programs\Swift\Runtimes\6.0.3\usr\bin;C:\Users\akash\AppData\Local\Programs\Swift\Toolchains\6.0.3+Asserts\usr\bin;C:\Users\akash\AppData\Local\Programs\Swift\Tools\6.0.3;C:\Users\akash\go\bin

Tools

go:	C:\Program Files\Go\bin\go.exe: go version go1.24.1 windows/amd64

gopls:	C:\Users\akash\go\bin\gopls.exe	(version: v0.18.1 built with go: go1.24.1)
gotests:	C:\Users\akash\go\bin\gotests.exe	(version: v1.6.0 built with go: go1.24.1)
gomodifytags:	not installed
impl:	not installed
goplay:	not installed
dlv:	not installed
staticcheck:	C:\Users\akash\go\bin\staticcheck.exe	(version: v0.6.1 built with go: go1.24.1)

Go env

Workspace Folder (Learn Go): c:\Learn Go

set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=1
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\akash\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\akash\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\akash\AppData\Local\Temp\go-build4191878669=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=NUL
set GOMODCACHE=C:\Users\akash\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\akash\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\akash\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.24.1
set GOWORK=
set PKG_CONFIG=pkg-config

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.toolsManagement.autoUpdate": true,

Describe the bug

Every time I press enter to create a new line, I cannot create a new line without first declaring something on the current line. if I don't declare something and press Enter to go to the new line, I will be pushed back to the line I was already on. It only happens after I declare 'package main', if I don't include that then everything works as usual. This only happens when I have the GO extension installed, once I uninstall it everything works fine, I have also already tested uninstalling my other extensions while having the GO extension installed, and the same problems keep occurring. Only when I uninstall/disable the GO extension is the problem fixed.

Steps to reproduce the behavior:

1.create Go file, with GO extension installed
2.Declare package main
3. press 'Enter" to go to a new line

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

20250325-0052-02.4816308.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions