Skip to content

Allow nodes to expand until a certain condition is met. #2789

@ghostbuster91

Description

@ghostbuster91

Can this functionality be implemented utilising API?
To some degree, see my PR.

Is your feature request related to a problem? Please describe.
I'm always frustrated when I work with java/scala projects. In these languages directory structure should reflect the namespace hierarchy which usually results in multiple nested directories with only a single child directory.

E.g. a namespace com.example.something will have the following directory structure:

modules/src
└── main
    └── com
        └── example
            └── something
                ├── bar.txt
                └── foo.txt

Describe alternatives you've considered

I have two options if I want to explore this structure and get to the bottom of it:

  1. expand nodes manually one by one until I reach the bottom
  2. use expand_all function but this has following downsides:
    • when I don't know the directory structure it might result in a lot of nodes being opened unnecessarily, which I will have to close later
    • when I do know the directory structure and I know that there are some additional directories I might still use expand_all knowing that I will have to close some of them
  3. use group_empty feature. I prefer to have a tree like structure. One reason for that is that it is more horizontally compact that the same structure rendered with group_empty enabled.

Describe the solution you'd like

I would like to have an option that allows me to recursively expand all directories as long as there is only one children that is also a directory. If a directory that has more children is encountered the expansion should be stopped (after expanding that directory).

This can be implemented in more generic way - expand until a certain, user provided, condition is met.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions