Languages / CMake · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

CMake

Declarative tree-sitter query plugin powered by QueryLanguagePlugin (rgctl-lang-runtime) and crates/rgctl-lang-cmake/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-cmake
Plugin
QueryLanguagePlugin (rgctl-lang-cmake)
Extensions
.cmake
Discover
rgctl discover . -l cmake
Function Kinds
function_def
Class / Container Kinds
—

Capture summary

CapturePatternsGraph mapping
@definition.function1Emits SymbolType::Function (acts as caller scope & container).
@definition.macro1Emits SymbolType::Macro.
@name3Symbol identifier or target callee/type name.
@reference.call1Emits RelationType::Calls from innermost enclosing function to @name.

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

; Tier-2 CMake tags for rgctl.

(function_def
  (function_command
    (argument_list
      . (argument) @name))) @definition.function

(macro_def
  (macro_command
    (argument_list
      . (argument) @name))) @definition.macro

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

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