Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: provide foldingRange for the case sections within a select #40146

Closed
atc0005 opened this issue Jul 10, 2020 · 3 comments
Closed

x/tools/gopls: provide foldingRange for the case sections within a select #40146

atc0005 opened this issue Jul 10, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@atc0005
Copy link

@atc0005 atc0005 commented Jul 10, 2020

Filing this report per @stamblerre's feedback on Gopher Slack #vscode channel

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

  • Run go version to get version of Go

    • go version go1.14.4 windows/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders

    • 1.47.0 d5e9aa0227e057a60c82568bf31c04730dc15dcd x64
  • gopls version

golang.org/x/tools/gopls 0.4.3
    golang.org/x/tools/gopls@v0.4.3 h1:irz7Q+XdHNECamFKbNWKvMV2Ak6zBbwdwbZndG4545I=
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.15.1
  • Run go env to get the go development environment details
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\atc0005\AppData\Local\go-build
set GOENV=C:\Users\atc0005\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\atc0005\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=T:\github\brick\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\atc0005\AppData\Local\Temp\go-build004075302=/tmp/go-build -gno-record-gcc-switches

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]": {
        "editor.defaultFormatter": "golang.go",
        "editor.suggest.insertMode":"replace"
    },
    "go.formatTool": "goimports",
    "go.useLanguageServer": true,
    "[go.sum]": {
        "editor.defaultFormatter": "golang.go"
    },
    "[go.mod]": {
        "editor.defaultFormatter": "golang.go"
    },
    "go.lintTool": "golangci-lint",
    "go.lintFlags": [
        "--new"
    ],
    "go.languageServerFlags": [
        //"-rpc.trace", // for more detailed debug logging
    ],
    // Force VSCode to use native Windows 10-provided SSH and by extension,
    // the ssh-agent holding the private key used to access private Git repos.
    // This unfortunately means that I will need to load the key twice: once
    // for Git for Windows terminal use and again for VSCode to use.
    "go.toolsEnvVars": {
        "GIT_SSH":"C:\\WINDOWS\\System32\\OpenSSH\\ssh.exe"
        //"GOPRIVATE": "github.com/atc0005/brick",
        // "GIT_ALLOW_PROTOCOL":""
    },

Describe the bug

I can expand case blocks within a switch statement, but cannot expand case blocks within a select statement.

Example of collapsing a case within a switch statement:

image

Example of where this isn't enabled for a case within a select statement:

image

Note: I can collapse the entire select statement, but that's not always the desired behavior.

While I cannot recall if this ever worked, this seems like odd behavior.

@hyangah hyangah changed the title Expanding/collapsing switch case sections offered, but not case sections within a select statement x/tools/gopls: provide foldingRange for the case sections within a select Jul 10, 2020
@hyangah
Copy link
Contributor

@hyangah hyangah commented Jul 10, 2020

Thanks for the feature request, @atc0005 !
This advanced language analysis feature is available through gopls, so I will transfer this issue to gopls issue tracker.

@hyangah hyangah transferred this issue from golang/vscode-go Jul 10, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jul 10, 2020
@atc0005
Copy link
Author

@atc0005 atc0005 commented Jul 10, 2020

@hyangah: Thanks for the feature request, @atc0005 !
This advanced language analysis feature is available through gopls, so I will transfer this issue to gopls issue tracker.

Thanks!

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v1.0.0 Jul 21, 2020
@dandua98 dandua98 self-assigned this Jul 29, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 29, 2020

Change https://golang.org/cl/245697 mentions this issue: internal/lsp: added folding range for select case statements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.