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: support folding regions in block comments #46253

Closed
stamblerre opened this issue May 19, 2021 · 6 comments
Closed

x/tools/gopls: support folding regions in block comments #46253

stamblerre opened this issue May 19, 2021 · 6 comments
Labels
FeatureRequest FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@stamblerre
Copy link
Contributor

stamblerre commented May 19, 2021

See the issue in the vscode-go repository: golang/vscode-go#1511.

Is your feature request related to a problem? Please describe.

I want to be able to comment out large portions of tests and then collapse them.

I tried the obvious (select a region and cmd+/), but that doesn't work:
microsoft/vscode#124104 (comment)

Describe the solution you'd like
either cmd-/ + folding works, or toggle block comment + folding works

Describe alternatives you've considered
I filed microsoft/vscode#124104

Additional context
image
image
image

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 19, 2021
@gopherbot gopherbot added this to the Unreleased milestone May 19, 2021
@stamblerre stamblerre added FeatureRequest and removed gopls Issues related to the Go language server, gopls. labels May 19, 2021
@stamblerre stamblerre changed the title x/tools/gopls: support folding block comments x/tools/gopls: support folding regions in block comments May 19, 2021
@dmitshur dmitshur added the gopls Issues related to the Go language server, gopls. label May 19, 2021
@ShoshinNikita
Copy link

I don't think it's a gopls issue. Rather, it's the unfortunate default behavior of VS Code. There's an option editor.comments.ignoreEmptyLines to toggle comments even for empty lines:

image

@stamblerre
Copy link
Contributor Author

Thanks for finding that, @ShoshinNikita! @jsoref, does that resolve the issue for you?

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 1, 2021
@jsoref
Copy link

jsoref commented Jun 1, 2021

I guess? It seems like it's designed for this use case (and applies evenly across the platform).

I pretty much never use this feature (perhaps because I've never trusted an IDE to be remotely smart, and this reenforces that opinion). (I tried it because colleagues were using it, and I needed to perform a routine task of isolating test cases until I could figure out which ones were failing.) (I'm actually quite impressed w/ VSC in general, and am using it to replace Notepad or similar.)

I expect I'm more likely to not use the comment-lines feature at all and return to manually adding /*...*/ around blocks.

@stamblerre
Copy link
Contributor Author

Ok, thanks for following up. Looks like this setting resolves the issue, so I will close this, as well as the upstream issue.

@stamblerre stamblerre removed this from the gopls/unplanned milestone Jun 1, 2021
@suzmue
Copy link
Contributor

suzmue commented Jun 4, 2021

I think this issue also covers that there is no folding range for block comments /* .. */ (which is also available as a command in VS Code), which could be addressed in gopls:

Screen Shot 2021-06-04 at 6 46 16 PM

@suzmue suzmue reopened this Jun 4, 2021
@suzmue suzmue self-assigned this Jun 4, 2021
@gopherbot
Copy link

Change https://golang.org/cl/325071 mentions this issue: internal/lsp: fix folding range for block comments

@stamblerre stamblerre added this to the gopls/v0.7.1 milestone Jun 7, 2021
@golang golang locked and limited conversation to collaborators Jun 7, 2022
@rsc rsc unassigned suzmue Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants