Ok... I'm closer now.
I see that I need to override SetOutliningNodeCollapsedText in the language.
However, is there any easy way to figure out which AstNode I'm collapsing? I don't see any easy way to do this rather than searching the AST itself to find the item. I would think the outlining parser already knows the node it's working on doesn't it? Is there any way for me to ask it which node the OutliningNode refers to?
I understand that an OutliningNode may not associate with an AstNode, in the case when the outlining node is added manually to the Outlining property, but in the case where it's added by the automatic outliner, can we have a property for the AstNode that gave rise to that outlining node? You could even make it store the ICollapsibleNode instead of the IAstNode if you deem that more flexible. Just some way to get back to the node would be nice...