dumpScope static method

void dumpScope(
  1. ZenScope scope,
  2. StringBuffer buffer,
  3. int indent
)

Recursively dump scope information with proper indentation

Implementation

static void dumpScope(ZenScope scope, StringBuffer buffer, int indent) {
  final indentStr = '  ' * indent;
  final dependencies = scope.getAllDependencies();

  buffer.writeln('$indentStr📁 ${scope.name ?? 'unnamed'} (${scope.id})');
  buffer.writeln('$indentStr   Dependencies: ${dependencies.length}');
  buffer.writeln('$indentStr   Disposed: ${scope.isDisposed}');

  if (dependencies.isNotEmpty) {
    final types = dependencies.map((d) => d.runtimeType.toString()).toSet();
    buffer.writeln('$indentStr   Types: ${types.join(', ')}');
  }

  // Recursively dump child scopes
  for (final child in scope.childScopes) {
    dumpScope(child, buffer, indent + 1);
  }
}