Doesn't seem to work to display the hierarchy in existing code unless you structure it using some syntax to allow for the code-folding to work.
I was hoping it would infer the structure automatically, quite unfortunate that this seems to require annotations to get any real value out of it. I wonder if it could be adapted to use something like ctags/LSP/tree-sitter for that purpose.