Skip to content
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

Closed
axefrog opened this issue Jun 28, 2018 · 67 comments
Closed

Outline view: collapsed by default (introduce optional setting?) #53262

axefrog opened this issue Jun 28, 2018 · 67 comments
Assignees
Labels
feature-request Request for new features or functionality on-release-notes Issue/pull request mentioned in release notes on-testplan outline Source outline view issues
Milestone

Comments

@axefrog
Copy link

axefrog commented Jun 28, 2018

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:

image

Bad:

image

@vscodebot
Copy link

vscodebot bot commented Jun 28, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jrieken jrieken added under-discussion Issue is under discussion for relevance, priority, approach outline Source outline view issues labels Jun 29, 2018
@jrieken
Copy link
Member

jrieken commented Jun 29, 2018

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

@axefrog
Copy link
Author

axefrog commented Jun 29, 2018

Could I not just apply the setting on a per-language basis?

@jrieken
Copy link
Member

jrieken commented Jun 29, 2018

Yeah, we can always have a setting

@axefrog axefrog changed the title Outline view: collapsed by default Outline view: collapsed by default (introduce optional setting?) Jul 4, 2018
@thorstenc
Copy link

A configuration settings option for the other outline options like 'Follow cursor' or the sort order would be great as well.

@jrieken
Copy link
Member

jrieken commented Jul 6, 2018

@thorstenc Not a configuration, but the sort order can be set via the menu (choice is persisted)

screen shot 2018-07-05 at 09 15 08

@jrieken jrieken added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Sep 11, 2018
@cipri-tom
Copy link

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.

@axefrog
Copy link
Author

axefrog commented Nov 20, 2018

@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.

2018-11-21_07-59-14

@AmeliaBR
Copy link

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.

@microsoft microsoft deleted a comment from v-kydela Jul 31, 2019
@Antisunny

This comment has been minimized.

@v-kydela

This comment has been minimized.

@blowsie
Copy link

blowsie commented Sep 27, 2019

In the mean time <Ctrl> + <LeftArrow> will collapse the entire list

@v-kydela
Copy link

@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

@v-kydela
Copy link

v-kydela commented Sep 27, 2019

@jrieken - Why did you delete my comment on July 30?

@jrieken
Copy link
Member

jrieken commented Oct 18, 2019

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...

@v-kydela
Copy link

@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

@jrieken jrieken added this to the Backlog milestone Oct 21, 2019
@Relequestual
Copy link

Here's my use case, which may present a proposed behaviour.
I have a javascript file with a number of functions.
I don't want to know about the contense of the functions, but I want to always know what function I'm actually in at a glance.

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"

@nikitavoloboev

This comment has been minimized.

@Relequestual

This comment has been minimized.

@Rusenec

This comment has been minimized.

@Relequestual

This comment has been minimized.

@pop1989bb
Copy link

I need as well a collapsed outline per default. So please devs provide us a function. It is now request since nearly 4 years.

@cha0s
Copy link

cha0s commented Mar 1, 2022

+1

1 similar comment
@alexanfl
Copy link

alexanfl commented Mar 7, 2022

+1

@alexanfl
Copy link

alexanfl commented Mar 7, 2022

I use the vim integration, and I have a temporary workaround that works for my usage. I focus the outline with <leader>+o and then navigate the outline with j and k.

By adding outline.collapse to my key bind (in vim.normalModeKeyBindings in settings.json), the outline is collapsed when I want to navigate it.

{
    "before" : ["<leader>", "o"],
    "commands" : [
        "outline.collapse",
        "outline.focus"
    ]
},

@jontwo
Copy link

jontwo commented Mar 30, 2022

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.

@bblaette
Copy link

bblaette commented Apr 1, 2022

+1
A config like 'outline depth = n' would make 90% happy. Quick win... then you can address edge cases

@ramdrop
Copy link

ramdrop commented Apr 10, 2022

+1, I want an optional setting to default collapsed outline.

@PetrusZ
Copy link

PetrusZ commented Apr 13, 2022

I need it too.

@rickstaa
Copy link

@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. 🚀

@langert
Copy link

langert commented Apr 19, 2022

Is there still no settings option for collapse all? Loved to have it...

@Nikratio
Copy link

+1

@wijjj
Copy link

wijjj commented Apr 28, 2022

Yes, indeed. This would still be great. :)

@waj-vx
Copy link

waj-vx commented Jun 16, 2022

You can hide all the variables & constants in the outline and have it only show methods/functions.

In settings. Go to Settings > Features > Explorer and turn off the Outline: Show variables and Outline: Show properties.

image

Best solution so far, thanks! Really anoying that this thing expands all the time.

@SergeyBeloglazovRL
Copy link

SergeyBeloglazovRL commented Jun 16, 2022

You can hide all the variables & constants in the outline and have it only show methods/functions.
In settings. Go to Settings > Features > Explorer and turn off the Outline: Show variables and Outline: Show properties.

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.

@swch01
Copy link

swch01 commented Jul 31, 2022

A default: collapsed setting would make studying large source files easier. It would also be nice if the outline window centered symbols when possible. Often, the outline scrolls the minimum amount to bring a symbol into view at the bottom of the screen. When that happens, I have to manually scroll the outline up to see the symbol's context.

@taranu
Copy link

taranu commented Aug 19, 2022

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:

For viewing files with less complicated structure, it is more handy to have the outline to be expanded by default. Now all I can see is c++ namespace after switching between c++ files, which is useless and very annoying.

Any chance to add toggle setting for this, or at least have a list.expandAll command?

@gjsjohnmurray
Copy link
Contributor

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

@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:

  1. Start VS Code fresh.
  2. Open two files whose language mode is able to populate the Outline view, For example, tasks.json and launch.json from a .vscode folder.
  3. Initially their outlines will display fully expanded,, but if you switch back and forth between them a couple of times they will suddenly collapse, and will re-collapse on subsequent switches.

@jrieken I'm hoping this PR isn't too late to be considered for 1.71, particularly as it fixes the bug described above.

@jrieken jrieken modified the milestones: Backlog, October 2022 Oct 5, 2022
jrieken added a commit that referenced this issue Oct 7, 2022
Add `outline.collapseItems` and fix outlines collapsing unexpectedly (#53262)
@jrieken
Copy link
Member

jrieken commented Oct 7, 2022

This will be part of 1.73.x and next insiders and is this setting: outline.collapseItems

@jrieken jrieken closed this as completed Oct 7, 2022
@jrieken jrieken added the on-release-notes Issue/pull request mentioned in release notes label Oct 27, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-release-notes Issue/pull request mentioned in release notes on-testplan outline Source outline view issues
Projects
None yet
Development

No branches or pull requests