File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,21 @@ public class NodeMetadata
1616 /// </summary>
1717 public string Title { get ; set ; } = string . Empty ;
1818
19+ /// <summary>
20+ /// the original title as written in source (before any rewriting by NodeGroupVisitor)
21+ /// </summary>
22+ public string ? SourceTitle { get ; set ; } = null ;
23+
24+ /// <summary>
25+ /// the rewritten unique title (e.g. "Meeting.happy" or "Meeting.checksum"), set by NodeGroupVisitor
26+ /// </summary>
27+ public string ? UniqueTitle { get ; set ; } = null ;
28+
29+ /// <summary>
30+ /// the node group name (equals sourceTitle when when: headers exist, null otherwise)
31+ /// </summary>
32+ public string ? NodeGroup { get ; set ; } = null ;
33+
1934 /// <summary>
2035 /// the subtitle of the node (optional)
2136 /// </summary>
Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ public override object VisitNode([NotNull] YarnSpinnerParser.NodeContext context
7878 // Visit children to extract all the metadata.
7979 base . VisitNode ( context ) ;
8080
81+ // Populate node group fields from the parse context.
82+ // NodeGroupVisitor runs before NodeMetadataVisitor, so these are already set.
83+ currentNode . SourceTitle = currentNode . Title ; // Always the original title: header value
84+ currentNode . UniqueTitle = context . NodeTitle ; // Rewritten by NodeGroupVisitor
85+ currentNode . NodeGroup = context . NodeGroup ; // Set by NodeGroupVisitor (null if not grouped)
86+
8187 // Only add nodes that have a title.
8288 if ( ! string . IsNullOrWhiteSpace ( currentNode . Title ) )
8389 {
You can’t perform that action at this time.
0 commit comments