Discussed in #20347
Originally posted by ZylosLumen July 31, 2025
fn a(
a_really_long_arg_name: (),
another_really_long_arg_name: (),
important_value: (),
) {
}
// ...
fn b(
a_really_long_arg_name: (),
another_really_long_arg_name: (),
important_value: (),
) {
}
#[inline]
fn c(
a_really_long_arg_name: (),
another_really_long_arg_name: (),
important_value: (),
) {
}
a
has a folding range on line with fn
and ) {
. The first folds everything including body, second one only body.
b
and c
have a folding range on line with fn
and ) {
. The first folds parameter list, second one only body.
I tried putting other kinds of items (struct, enum, type, use, mod) but only comments and attributes exhibit this behaviour. What is the reason for this? In all cases you can fold the body separately, but not the argument list. I understand that it would be hard to support choosing between folding the whole function and argument list but it is annoying to only have the arguments fold when wanting to fold the entire function.