-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: fix folding range for function calls #70467
Labels
Milestone
Comments
Related Issues (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
ShoshinNikita
added a commit
to ShoshinNikita/tools
that referenced
this issue
Nov 20, 2024
Make folding ranges for function calls consistent with folding ranges for function bodies and composite literals: - keep the closing parenthesis visible - do not generate a folding range if either the first or last argument is on the same line as the opening or closing parenthesis Fixes golang/go#70467
Change https://go.dev/cl/630056 mentions this issue: |
ShoshinNikita
added a commit
to ShoshinNikita/tools
that referenced
this issue
Nov 22, 2024
Make folding ranges for function calls consistent with folding ranges for function bodies and composite literals: - keep the closing parenthesis visible - do not generate a folding range if either the first or last argument is on the same line as the opening or closing parenthesis Also refactor some code, add additional comments and test cases. Fixes golang/go#70467
ShoshinNikita
added a commit
to ShoshinNikita/tools
that referenced
this issue
Nov 27, 2024
Make folding ranges for function calls consistent with folding ranges for function bodies and composite literals: - keep the closing parenthesis visible - do not generate a folding range if either the first or last argument is on the same line as the opening or closing parenthesis In order to achieve this, calculate folding ranges by analyzing whitespace in the source instead of analyzing AST. Fixes golang/go#70467
ShoshinNikita
added a commit
to ShoshinNikita/tools
that referenced
this issue
Nov 27, 2024
Make folding ranges for function calls consistent with folding ranges for function bodies and composite literals: - keep the closing parenthesis visible - do not generate a folding range if either the first or last argument is on the same line as the opening or closing parenthesis In order to achieve this, calculate folding ranges by analyzing whitespace in the source instead of analyzing AST. Fixes golang/go#70467
Change https://go.dev/cl/633701 mentions this issue: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gopls version:
gopls@e751756
(master
branch)Fold calls to
sort.Slice
andfmt.Println
in VSCode (or, likely, any other editor withLineFoldingOnly
set totrue
):Not only the arguments but also the closing parentheses are being folded. There are several issues with this behavior:
fmt.Println
to add more code. This behavior is particularly frustrating when working with calls liket.Run
.}
is always visible.The text was updated successfully, but these errors were encountered: