Hello, the "SyntaxEditor Outlining and Collapsing Features" documentation topics talk about outlining. Specifically the "Code Outlining (Folding)" topic lists the command for collapse to definitions and what it's doing.
Also, our CodeOutliningCollapsedText QuickStart shows how to make a custom node definition that is an "implementation", which is used for collapse to definitions.