Skip to content

Folded code unfolds on syntax error #1224

@infalmo

Description

@infalmo

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go from the VS Code integrated terminal.
    go version go1.15.8 linux/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
Build info
----------
golang.org/x/tools/gopls v0.6.5
    golang.org/x/tools/[email protected] h1:kLt9rD/dWtVdvc8LmdcxagDFih6zxYXREpKSYYZu5KE=
    github.com/BurntSushi/[email protected] h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/[email protected] h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
    github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/[email protected] h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
    golang.org/x/[email protected] h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
    golang.org/x/[email protected] h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
    golang.org/x/[email protected] h1:/wdPW261t381NDQd8TBo63/FyvACfLICwtH8wMRoHJQ=
    golang.org/x/[email protected] h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/[email protected] h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
    mvdan.cc/[email protected] h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=
    mvdan.cc/xurls/[email protected] h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
1.53.2
622cb03f7e070a9670c94bae1a45d78d7181fbd4
x64
  • Check your installed extensions to get the version of the VS Code Go extension
    0.22.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/infinitepro/go
GOROOT: /usr/lib/go
PATH: /home/infinitepro/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

   gopkgs: /home/infinitepro/go/bin/gopkgs installed
   go-outline: /home/infinitepro/go/bin/go-outline installed
   gotests: /home/infinitepro/go/bin/gotests installed
   gomodifytags: /home/infinitepro/go/bin/gomodifytags installed
   impl: /home/infinitepro/go/bin/impl installed
   goplay: /home/infinitepro/go/bin/goplay installed
   dlv: /home/infinitepro/go/bin/dlv installed
   golint: /home/infinitepro/go/bin/golint installed
   gopls: /home/infinitepro/go/bin/gopls installed

go env
Workspace Folder (cpt-lib): /home/infinitepro/Desktop/GitHub/cp-tools/cpt-lib
	GO111MODULE=""
	GOARCH="amd64"
	GOBIN=""
	GOCACHE="/home/infinitepro/.cache/go-build"
	GOENV="/home/infinitepro/.config/go/env"
	GOEXE=""
	GOFLAGS=""
	GOHOSTARCH="amd64"
	GOHOSTOS="linux"
	GOINSECURE=""
	GOMODCACHE="/home/infinitepro/go/pkg/mod"
	GONOPROXY=""
	GONOSUMDB=""
	GOOS="linux"
	GOPATH="/home/infinitepro/go"
	GOPRIVATE=""
	GOPROXY="https://proxy.golang.org,direct"
	GOROOT="/usr/lib/go"
	GOSUMDB="sum.golang.org"
	GOTMPDIR=""
	GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
	GCCGO="gccgo"
	AR="ar"
	CC="gcc"
	CXX="g++"
	CGO_ENABLED="1"
	GOMOD="/home/infinitepro/Desktop/GitHub/cp-tools/cpt-lib/go.mod"
	CGO_CFLAGS="-g -O2"
	CGO_CPPFLAGS=""
	CGO_CXXFLAGS="-g -O2"
	CGO_FFLAGS="-g -O2"
	CGO_LDFLAGS="-g -O2"
	PKG_CONFIG="pkg-config"
	GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build229485445=/tmp/go-build -gno-record-gcc-switches"

Describe the bug

  • Write some foldable code (loop, conditional statements etc).
  • Fold the code blocks.
  • Start writing a new line of code and stop midway (ensure there is a syntax error)
  • Have the previously folded code automatically unfolded.

Screenshots or recordings

Screencast.from.12-02-21.05_12_30.PM.IST.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgegoplsgopls related issuesupstream-toolsIssues that are caused by problems in the tools that the extension depends on.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions