rust-analyzer
rust-analyzer copied to clipboard
feature request: deeper display for outline functions
I think that it would be nice to have the outline go deeper into functions and also show match arms as an entry

I think that would be far too cluttered. The outline is supposed to be an outline, not a complete syntax tree.
Yeah, the outline is just meant to be an item-level outline of the code. What's the use case for making it so detailed? Maybe there's a better way to show the information you're looking for.
I personally just like the feeling of the outline in my react project, where I can easily find functions in the outline even when I just remember the code vaguely (as you can see below) - but it's probably just a personal preference ^^

about the clutter tho - you could just close the tabs down if you dont want them to clutter the outline afaik
We can (and do) show nested items:

But I don't think it makes sense to show function calls or match arms. Does that even happen in the screenshot you've posted?
Well yes and no - the useEffect() is a function call, however afaik there are no match statements in react ^^"
the useEffect() is a function call
It has a special meaning in react that has non-local effects. The outline doesn't show all function calls for react either.
I don't know much about React, but I imagine JavaScript still has switch?
We show items in the outline (functions, traits, structs, impls), but not expressions. I don't think we should include local variables or match arms. Those often look like this:

Other than useEffect, we don't show less information than the JS/React extension.
Closing this as wontfix. As mentioned before, the outline is meant for items, not arbitrarily small syntax like match arms.