Implement query search enum #17

Closed
opened 2026-09-03 14:22:18 +00:00 by JayKobe6k · 0 comments
Owner

Goal

Search C enum declarations and definitions with canonical identity and scope filters.

Filters and results

  • Support --identifier, --translation-unit, --function, --name, --struct, and --enum for applicable enclosing scopes.
  • Apply shared --max-results, --group-by, and --order-by behavior.
  • Define canonical identity for tagged, typedef-named, anonymous, nested, forward-declared where supported, and multiply declared enums.
  • Return canonical/display name, enclosing scopes, definition/declaration status, source anchors, underlying/canonical type information available from libclang, enumerator names/values, and a durable enum handle.

Do not add value-lineage filters to enums. Enumerator-specific filtering can be a follow-up unless required to satisfy the initial use cases; the initial result must still expose enumerators.

Acceptance criteria

  • Tests cover tagged/anonymous enums, typedef aliases, duplicate declarations, same tags in different scopes/TUs, local/nested enums, implicit and explicit enumerator values, and scope regex combinations.
  • Declaration duplicates are canonicalized with source occurrences retained.
  • Grouping/ordering fields have documented valid/invalid combinations.
  • Text output disambiguates anonymous and same-named enums; JSON preserves exact anchors and typed enumerator values.
  • LadybugDB uses explicit enum/enumerator nodes and relationships with mapping tests.

Dependencies

Depends on enum/type extraction in #7 and shared search behavior in #13.

## Goal Search C enum declarations and definitions with canonical identity and scope filters. ## Filters and results - Support `--identifier`, `--translation-unit`, `--function`, `--name`, `--struct`, and `--enum` for applicable enclosing scopes. - Apply shared `--max-results`, `--group-by`, and `--order-by` behavior. - Define canonical identity for tagged, typedef-named, anonymous, nested, forward-declared where supported, and multiply declared enums. - Return canonical/display name, enclosing scopes, definition/declaration status, source anchors, underlying/canonical type information available from libclang, enumerator names/values, and a durable enum handle. Do not add value-lineage filters to enums. Enumerator-specific filtering can be a follow-up unless required to satisfy the initial use cases; the initial result must still expose enumerators. ## Acceptance criteria - Tests cover tagged/anonymous enums, typedef aliases, duplicate declarations, same tags in different scopes/TUs, local/nested enums, implicit and explicit enumerator values, and scope regex combinations. - Declaration duplicates are canonicalized with source occurrences retained. - Grouping/ordering fields have documented valid/invalid combinations. - Text output disambiguates anonymous and same-named enums; JSON preserves exact anchors and typed enumerator values. - LadybugDB uses explicit enum/enumerator nodes and relationships with mapping tests. ## Dependencies Depends on enum/type extraction in #7 and shared search behavior in #13.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
JayKobe6k/ClariTree#17
No description provided.