fix: Map expansion now matches nested child steps (gt-8tmz.33)
The map rule was only iterating over top-level steps, missing nested children. Now uses buildStepMap to include all steps at any depth. Added test case for map expansion over nested children. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,10 +112,12 @@ func ApplyExpansions(steps []*Step, compose *ComposeRules, parser *Parser) ([]*S
|
||||
return nil, fmt.Errorf("map: %q has no template steps", rule.With)
|
||||
}
|
||||
|
||||
// Find all matching steps
|
||||
// Find all matching steps (including nested children - gt-8tmz.33)
|
||||
// Rebuild stepMap to capture any changes from previous expansions
|
||||
stepMap = buildStepMap(result)
|
||||
var toExpand []*Step
|
||||
for _, step := range result {
|
||||
if MatchGlob(rule.Select, step.ID) && !expanded[step.ID] {
|
||||
for id, step := range stepMap {
|
||||
if MatchGlob(rule.Select, id) && !expanded[id] {
|
||||
toExpand = append(toExpand, step)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user