Skip to main content

Crate shuck_indexer

Crate shuck_indexer 

Source
Expand description

Positional and structural indexes over parsed shell scripts.

The indexer complements shuck-parser by building compact lookup tables for source lines, comments, syntactic regions, heredoc bodies, and physical line continuations. It is intended to be built once from parser output and then shared by semantic analysis, lint rules, suppressions, formatters, and report rendering.

All positions are byte offsets represented with shuck_ast::TextSize and shuck_ast::TextRange. The crate does not build a character index: callers that need display columns should combine these byte offsets with the original source text at the UI boundary.

Indexer is the preferred construction path when parser output is available. The lower-level indexes are also exported for integrations that only need line mapping or that already have an AST-shaped source of comments or regions.

Structs§

CommentIndex
Comment lookup types derived from parser output. Comment ranges and line-oriented lookup metadata.
IndexedComment
Comment lookup types derived from parser output. A source comment with resolved positional metadata.
IndexedHeredoc
Structural region indexes over parsed shell source. Indexed metadata for one heredoc body and its source closer.
Indexer
Pre-computed positional and structural index over a parsed shell script.
IndexerOptions
Optional index families that are not needed by every consumer.
LineIndex
Line-based offset lookup utilities. Maps between byte offsets and 1-based source lines.
RegionIndex
Structural region indexes over parsed shell source. Byte ranges of syntactic regions where special rules apply.

Enums§

LineEndingStyle
Line-based offset lookup utilities. Source line-ending style inferred while indexing physical lines.
RegionKind
Structural region indexes over parsed shell source. A syntactic region that affects source interpretation.