index

package
v0.17.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSymbols

type FileSymbols struct {
	File    string   `json:"file"`
	Symbols []Symbol `json:"symbols"`
}

func SearchSymbolFiles

func SearchSymbolFiles(idx *SymbolIndex, tokens []string) []FileSymbols

SearchSymbolFiles returns files whose symbols match any of the provided tokens (case-insensitive). For each matching file, only the matching symbols are included. Returns empty slice (not nil) if no matches.

type Symbol

type Symbol struct {
	Name string `json:"name"`
	Kind string `json:"kind"` // func, class, type, method, interface, constant, variable, struct, enum, trait, impl
	Line int    `json:"line,omitempty"`
}

type SymbolIndex

type SymbolIndex struct {
	Files []FileSymbols `json:"files"`
}

func BuildSymbols

func BuildSymbols(root string) (*SymbolIndex, error)

BuildSymbols scans the workspace root for source files and extracts symbols using tree-sitter AST for supported languages (Go, Python, TypeScript, JavaScript) with regex fallback for others. Results are sorted by file path and then by line number within each file.

func LoadSymbols

func LoadSymbols(root string) (*SymbolIndex, error)

LoadSymbols reads the cached symbol index from {root}/.sprout/symbols.json. Returns nil, nil if the cache file doesn't exist.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL