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

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

Open
ghostbuster91 opened this issue Jun 1, 2024 · 0 comments
Open

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

ghostbuster91 opened this issue Jun 1, 2024 · 0 comments

Comments

@ghostbuster91
Copy link
Contributor

ghostbuster91 commented Jun 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant