Languages / Haskell · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

Haskell

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

Capture summary

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

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

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

(function
  name: [
    (variable) @name
    (prefix_id) @name
  ]) @definition.function

(module
  (module_id) @name) @definition.module

(class
  name: (name) @name) @definition.interface

(data_type
  name: (name) @name) @definition.class

(newtype
  name: (name) @name) @definition.type

(apply
  function: (variable) @name) @reference.call

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

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