searchOccurrencePaths method

List<String> searchOccurrencePaths(
  1. String query, {
  2. int? limit,
})

Find hierarchical occurrence paths matching query.

Similar to searchSignalPaths but for occurrences instead of signals. Walks the tree, matching name segments incrementally. When the query segments match occurrence names at or below the current level the full path is returned (e.g. Top/CPU/ALU).

Returns up to limit results.

Implementation

List<String> searchOccurrencePaths(String query, {int? limit}) {
  final effectiveLimit = limit ?? defaultHierarchySearchLimit;
  if (query.trim().isEmpty) {
    return const [];
  }
  final parts = _splitPath(query);
  final results = <String>[];
  _searchOccurrencePathsRecursive(
      root, [root.name], parts, 0, results, effectiveLimit);
  return results;
}