Languages / CUDA · Edit queries/tags.scm
Tier 2 · Declarative tags.scmCUDA
Declarative tree-sitter query plugin powered by QueryLanguagePlugin (rgctl-lang-runtime) and crates/rgctl-lang-cuda/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-cuda
- Plugin
- QueryLanguagePlugin (rgctl-lang-cuda)
- Extensions
- .cu, .cuh
- Discover
- rgctl discover . -l cuda
- Function Kinds
- function_definition
- Class / Container Kinds
- struct_specifier, class_specifier
Capture summary
| Capture | Patterns | Graph mapping |
|---|---|---|
| @definition.class | 2 | Emits SymbolType::Class (acts as enclosing container). |
| @definition.function | 1 | Emits SymbolType::Function (acts as caller scope & container). |
| @import.path | 1 | Emits SymbolType::Import with normalized import_path metadata. |
| @name | 4 | Symbol identifier or target callee/type name. |
| @reference.call | 1 | Emits RelationType::Calls from innermost enclosing function to @name. |
Query source (crates/rgctl-lang-cuda/queries/tags.scm)
; Tier-2 CUDA tags for rgctl.
(function_definition
declarator: (function_declarator
declarator: (identifier) @name)) @definition.function
(struct_specifier
name: (type_identifier) @name) @definition.class
(class_specifier
name: (type_identifier) @name) @definition.class
(preproc_include
path: (_) @import.path)
(call_expression
function: (identifier) @name) @reference.call
Related: Tier 2 language support · Tier 1 language support · Discovering and indexing