Skip to main content

unified_query

Function unified_query 

Source
pub fn unified_query(
    selector_str: &str,
    scope: &Scope,
    code_cache: &mut CodeCache,
    store: &mut AnnotationStore,
    resolvers: &ResolverRegistry,
    opts: Option<&QueryOptions>,
) -> Result<Vec<QueryResult>, AqlError>
Expand description

Main query entry point.

Pipeline:

  1. Parse selector. If tag is not in CODE_TAGS, rewrite to [ann_tag="{tag}"] + original attrs.
  2. code_cache.ensure_scope(scope, resolvers) — lazy parse code files.
  3. Refresh annotation sidecars in scope.
  4. For each file in scope: flatten CodeElement tree, look up annotations, build UnifiedNode list.
  5. Match unified nodes against selector via filter_by_selector.
  6. Build QueryResult from matched nodes (deduplicate by source location).