Languages / PowerShell · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

PowerShell

Declarative tree-sitter query plugin powered by QueryLanguagePlugin (rgctl-lang-runtime) and crates/rgctl-lang-powershell/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-powershell
Plugin
QueryLanguagePlugin (rgctl-lang-powershell)
Extensions
.ps1, .psm1
Discover
rgctl discover . -l powershell
Function Kinds
function_statement
Class / Container Kinds
class_statement

Capture summary

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

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

; Tier-2 PowerShell tags for rgctl.

(function_statement
  (function_name) @name) @definition.function

(class_statement
  (simple_name) @name) @definition.class

(command
  (command_name) @name) @reference.call

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