-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: support folding multiline arg list & fn body in one folding range #20054
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I don't think the previous behavior is useful enough to warrant a setting, but maybe someone disagrees? @rust-lang/rust-analyzer
Also, can you please add a test?
I'd love if we could support both at the same time, that is if editors (VSCode ...) were smarter to be honest, generally I do agree when someone folds a function they want to fold the function, not the signature in the vast majority of cases. I wonder if we can either hook this in the typescript side to combine the folding ranges (probably needs heuristics which sound bad), or if we can emit the current behavior but also a full function fold and see what happens (as in how clients deal with that). Either way +1 for having this do the expected thing by default somehow. |
It would be very interesting to utilize For example, even though we have folded the entire fn, we can still display a "simplified parameter list" using |
The failing test is a flaky one(#20220) so I think this is good to go |
@ChayimFriedman2 I think the requested changes have been handled. Could you resolve the request? |
FWIW I don't think the request blocks merging, but I approved now. |
Thanks! I'm not sure whether this was blocked or not but GitHub's UI said so 😅 |
Thanks! |
It would be convenient to just one-click fold arg list and func body(TypeScript does). However, this behavior is inconsistent with now, perhaps we need a configurable setting that allows users to customize it?
close #19299