function completion should be vertical
I did search the issues, but I couldn't find searching for "Vertical". If this is duplicate or phrased differently elsewhere kindly forgive.
the issue
Using functions from the pop up menu is the min use of zls (and LSPs in general). For example, I type std.sort.h and I get heap as one of the suggestions. I press Enter and get this in the editor:
std.sort.heap(comptime T: type, items: []T, context: anytype, comptime lessThanFn: fn(@TypeOf(context), lhs:T, rhs:T)bool)
The problem is twofold:
- first: this is word salad to me. I can't at a glance tell how many parameters and what their types are.
- even if going at them one by one (and filling them one by one), I use Tab to move between the items, and it mostly works, except when it loses focus for some reason and it types the tab character and I have to do it manually with mouse and arrows.
the suggestion
make it fill in like this
std.sort.heap(
comptime T: type,
items: []T,
context: anytype,
comptime lessThanFn: fn(@TypeOf(context), lhs:T, rhs:T)bool,
)
this way it is instantly easier to see how many, and what types. It is also easier to navigate when the tab-based-jumping loses focus for whatever reason.
This is by far the most frequent paper cut I get with zls. It is especially annoying in functions that take a large amount of parameters like 8 or more.
or even more vertical
One step further, ideally for me, would be to fill in like this std.sort.heap(
comptime T: type,
items: []T,
context: anytype,
comptime lessThanFn: fn(
@TypeOf(context),
lhs:T,
rhs:T
)bool,
)
but I am not unreasonable.
This should be opt-in at most. I really don't like sacrificing vertical real estate, especially with function calls that can (and should be) within 80 columns.