-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
Outline view: collapsed by default (introduce optional setting?) #53262
Comments
(Experimental duplicate detection) |
Yeah, that's a tricky one. The current logic reveals one level down and that should work well with one-file-one-type languages like Java. In language like JavaScript that might not be ideal. Needs some thinking |
Could I not just apply the setting on a per-language basis? |
Yeah, we can always have a setting |
A configuration settings option for the other outline options like 'Follow cursor' or the sort order would be great as well. |
@thorstenc Not a configuration, but the sort order can be set via the menu (choice is persisted) |
I would enhance this a bit further by saying that outline view should remember the collapsing state. In other words, if I collapse all, then change to Source control view, when I get back into Explorer view the items are expanded again. This should also work if I collapse all, then expand just one item, then change views. When I come back to explorer view, only that item should be expanded. |
@jrieken One thing I have often wished for is a way to organise my code without the constraints of a rigid file structure. Code is a graph, and I often wish there was a way to present me with the bits of code I care about (pinned, adjacent, degrees-of-separation, etc.). When I'm prototyping and doing R&D in general, I end up with large amounts of code I don't want in focus, but creating new files constantly, and managing imports and exports between those files, is extremely inefficient when I don't even know if I'll need to keep a large amount of the code I'm fleshing out. Being able to see a higher-level overview via the outline panel is at least something in the absence of a solution to the above, but when it behaves like a wall of text that doesn't even remember the state of collapsed/expanded nodes, or have any form of contextual link to what I'm doing in the moment, it feels like a missed opportunity to be a really useful tool. |
I agree the ideal solution to this problem is to have a configuration setting, which can be customized by file type or project. I'd go farther and say that the ideal configuration isn't just "expanded" vs "collapsed", but instead a depth level, e.g., expand to level 3 of nested structure. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
In the mean time |
@blowsie - That's good to know, but since you have to focus on the outline window first it's no easier than just clicking the "collapse all" button |
@jrieken - Why did you delete my comment on July 30? |
Collapsing items is actually fair easy - the question is what to do when "Follow Cursor" mode is on? That mode always reveal and hence expands the current item and it will leave many expanded items behind. Not sure if auto-closing those elements that where already expanded is in reach... |
@jrieken - The issue is that many VS Code users would like an option to have the items in the outline panel collapsed by default so we don't have to click "collapse all" for every file we open when we're browsing through many files in a library |
Here's my use case, which may present a proposed behaviour. I guess my request COULD be served by being able to lock the tree so it doesn't expand or contract, but still follow cursor. I'm forever clicking "collapse all" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I need as well a collapsed outline per default. So please devs provide us a function. It is now request since nearly 4 years. |
+1 |
1 similar comment
+1 |
I use the vim integration, and I have a temporary workaround that works for my usage. I focus the outline with By adding {
"before" : ["<leader>", "o"],
"commands" : [
"outline.collapse",
"outline.focus"
]
}, |
I've probably spent longer reading this thread than I will actually clicking the Collapse All button every time I go to the Outline view, but it would still be nice if there was a setting that made collapsed the default. |
+1 |
+1, I want an optional setting to default collapsed outline. |
I need it too. |
@PetrusZ, I understand that you want to state your support for this great feature request. However, maybe in the future, it is an idea to add a 👍🏻 if a comment does not add extra information to the future request. Doing it this way keeps people's mailboxes clean. 🚀 |
Is there still no settings option for collapse all? Loved to have it... |
+1 |
Yes, indeed. This would still be great. :) |
Best solution so far, thanks! Really anoying that this thing expands all the time. |
Unfortunately it doesn't suit for JavaScript objects, declared as variables. |
A |
I'm so confused. I have the exact opposite problem - the C++ outline is collapsed by default, so the only thing it shows is a namespace. Worse still, it re-collapses every time I switch tabs, and there is no expand all button, only a collapse all button. Am I missing something? Only sirius0xff made a similar comment:
|
@taranu while implementing PR #158650 to add a setting that loads outlines collapsed rather than expanded I found and fixed the bug that's probably biting you. To reproduce it:
@jrieken I'm hoping this PR isn't too late to be considered for 1.71, particularly as it fixes the bug described above. |
Add `outline.collapseItems` and fix outlines collapsing unexpectedly (#53262)
This will be part of 1.73.x and next insiders and is this setting: |
Very simple request: I'd like the outline view tree to be collapsed by default. It'd be great if there were a configuration setting for this. To be clear, I'm referring to the items in the tree, not the panel itself.
Good:
Bad:
The text was updated successfully, but these errors were encountered: