Documentation
¶
Overview ¶
Package searchast parses a source code file to build a tree structure representing code scopes. It allows for searching specific patterns and understanding their context within the code's hierarchy.
Index ¶
- func NewContextBuilder(opts ...Option) *contextBuilder
- func NewSourceTree(ctx context.Context, r io.Reader, filename string) (*sourceTree, error)
- type Formatter
- type Option
- type Set
- type TextFormatter
- type TextFormatterOption
- func WithColors(enabled bool) TextFormatterOption
- func WithContextSymbol(symbol string) TextFormatterOption
- func WithGapSymbol(symbol string) TextFormatterOption
- func WithHighlightSymbol(symbol string) TextFormatterOption
- func WithLineNumbers(lineNumbers bool) TextFormatterOption
- func WithSpacer(spacer string) TextFormatterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContextBuilder ¶
func NewContextBuilder(opts ...Option) *contextBuilder
Types ¶
type Option ¶
type Option func(*contextBuilder)
func WithChildLines ¶
func WithChildLines(lines lineNumber) Option
WithChildLines enables or disables the inclusion of child context.
func WithCloseScopeGaps ¶
WithCloseScopeGaps enables or disables the inclusion of lines between the start and end of a scope.
func WithExpandChildScopes ¶
WithExpandChildScopes enables or disables the inclusion of all lines within child scopes of matched lines.
func WithGapToClose ¶
func WithGapToClose(gap lineNumber) Option
WithGapToClose sets the maximum gap between lines that should be filled in.
func WithParentContext ¶
WithParentContext enables or disables the inclusion of parent context.
func WithSurroundingLines ¶
func WithSurroundingLines(lines lineNumber) Option
WithSurroundingLines enables or disables the inclusion of surrounding lines.
type Set ¶
type Set[T comparable] map[T]struct{}
func NewSet ¶
func NewSet[T comparable]() Set[T]
func NewSetFromSlice ¶
func NewSetFromSlice[T comparable](s []T) Set[T]
type TextFormatter ¶
type TextFormatter struct {
// contains filtered or unexported fields
}
func NewTextFormatter ¶
func NewTextFormatter(opts ...TextFormatterOption) *TextFormatter
type TextFormatterOption ¶
type TextFormatterOption func(*TextFormatter)
func WithColors ¶
func WithColors(enabled bool) TextFormatterOption
func WithContextSymbol ¶
func WithContextSymbol(symbol string) TextFormatterOption
func WithGapSymbol ¶
func WithGapSymbol(symbol string) TextFormatterOption
func WithHighlightSymbol ¶
func WithHighlightSymbol(symbol string) TextFormatterOption
func WithLineNumbers ¶
func WithLineNumbers(lineNumbers bool) TextFormatterOption
func WithSpacer ¶
func WithSpacer(spacer string) TextFormatterOption
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
overview
command
|
|
|
searchast
command
|
|
|
Package language provides a convenient interface for retrieving the corresponding tree-sitter language object for a given file extension.
|
Package language provides a convenient interface for retrieving the corresponding tree-sitter language object for a given file extension. |