Languages / Racket · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

Racket

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

Capture summary

CapturePatternsGraph mapping
@_kw8Lexical scope capture.
@definition.class1Emits SymbolType::Class (acts as enclosing container).
@definition.function2Emits SymbolType::Function (acts as caller scope & container).
@import.path1Emits SymbolType::Import with normalized import_path metadata.
@name5Symbol identifier or target callee/type name.
@reference.call1Emits RelationType::Calls from innermost enclosing function to @name.

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

; Tier-2 Racket tags for rgctl.

(list
  . (symbol) @_kw (#any-of? @_kw "define" "define-syntax")
  . (symbol) @name) @definition.function

(list
  . (symbol) @_kw (#eq? @_kw "define")
  . (list . (symbol) @name)) @definition.function

(list
  . (symbol) @_kw (#eq? @_kw "struct")
  . (symbol) @name) @definition.class

(list
  . (symbol) @_kw (#eq? @_kw "require")
  . (_) @import.path)

(list
  . (symbol) @name
  (#not-any-of? @name "define" "define-syntax" "lambda" "let" "let*" "letrec" "if" "cond" "begin" "quote" "set!" "struct" "require" "provide" "module")) @reference.call

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