Languages / Gleam · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

Gleam

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

Capture summary

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

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

; Tier-2 Gleam tags for rgctl.

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

(type_definition
  (type_name) @name) @definition.class

(type_alias
  (type_name) @name) @definition.type

(import
  module: (module) @import.path)

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

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