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

Any way to define different types for children of a node in an extension? #1127

Open
jsadusk opened this issue Nov 2, 2024 · 2 comments
Open

Comments

@jsadusk
Copy link

jsadusk commented Nov 2, 2024

Specifically, I'm building an extension with a variadic entry point. The things under the variadic trees are completely different. I haven't figured out a way to make a different tree structure for the different top level nodes.

To this effect, I tried putting

:child-type (if (some-predicate item) `one-node-type `another-node-type)

But it failed, I'm assuming because it is expecting a quoted symbol in :child-type

@Alexander-Miller
Copy link
Owner

Dynamic children like that are not quite possible - when a node is expanded treemacs gathers a bunch of information based on the child-type just once, regardless of how many children are created.

You shoud still be able to use the "mono-type" node approach described here:
https://github.com/Alexander-Miller/treemacs/blob/master/Extensions.org#monotyped-nodes

@jsadusk
Copy link
Author

jsadusk commented Nov 5, 2024

Ah, thank you, I saw this section but didn't understand how it applied to my situation. This will work for my purposes.

By the way, this is my work in progress:
https://github.com/jsadusk/trunk-io-tree

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

2 participants