getAllTrackedScopes static method

List<ZenScope> getAllTrackedScopes()

Get all tracked scopes (persistent + auto-dispose + root) This ensures we capture both tracked scopes and dynamically created child scopes

Implementation

static List<ZenScope> getAllTrackedScopes() {
  final allScopes = <ZenScope>[];

  // Add all persistent scopes
  allScopes.addAll(_persistentScopes.values);

  // Add all auto-dispose scopes
  allScopes.addAll(_autoDisposeScopes.values);

  // Always include root scope if not already tracked
  if (!allScopes.contains(rootScope)) {
    allScopes.add(rootScope);
  }

  return allScopes;
}