Languages / Ada · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

Ada

Declarative tree-sitter query plugin powered by QueryLanguagePlugin (rgctl-lang-runtime) and crates/rgctl-lang-ada/queries/tags.scm. Compiles once at startup, validates captures against the Tier-2 vocabulary gate, and extracts symbols, container hierarchy (Container::member), imports, and call edges.

Grammar Crate
tree-sitter-ada
Plugin
QueryLanguagePlugin (rgctl-lang-ada)
Extensions
.adb, .ads, .ada
Discover
rgctl discover . -l ada
Function Kinds
subprogram_declaration, subprogram_body
Class / Container Kinds
full_type_declaration, task_type_declaration, protected_type_declaration

Capture summary

CapturePatternsGraph mapping
@definition.class2Emits SymbolType::Class (acts as enclosing container).
@definition.function4Emits SymbolType::Function (acts as caller scope & container).
@definition.module2Emits SymbolType::Module (acts as enclosing container).
@definition.type2Emits SymbolType::Type (acts as enclosing container).
@import.path1Emits SymbolType::Import with normalized import_path metadata.
@name12Symbol identifier or target callee/type name.
@reference.call2Emits RelationType::Calls from innermost enclosing function to @name.

Query source (crates/rgctl-lang-ada/queries/tags.scm)

; Tier-2 Ada tags for rgctl (`handler = "queries"`).

(package_declaration
  name: (identifier) @name) @definition.module

(package_body
  name: (identifier) @name) @definition.module

(subprogram_body
  (function_specification
    name: (identifier) @name)) @definition.function

(subprogram_body
  (procedure_specification
    name: (identifier) @name)) @definition.function

(subprogram_declaration
  (function_specification
    name: (identifier) @name)) @definition.function

(subprogram_declaration
  (procedure_specification
    name: (identifier) @name)) @definition.function

(full_type_declaration
  (identifier) @name) @definition.type

(private_type_declaration
  (identifier) @name) @definition.type

(task_type_declaration
  (identifier) @name) @definition.class

(protected_type_declaration
  (identifier) @name) @definition.class

(with_clause
  [(identifier) (selected_component)] @import.path)

(function_call
  (identifier) @name) @reference.call

(procedure_call_statement
  name: (identifier) @name) @reference.call

Related: Tier 2 language support · Tier 1 language support · Discovering and indexing