starindex

package
v0.1.0-dev.20260306090209 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package starindex provides AST-based indexing of Starlark source files, extracting functions, loads, globals, and line statistics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Files  []IndexedFile
	Totals IndexTotals
}

Index holds the index results for all captured files.

type IndexTotals

type IndexTotals struct {
	FileCount, Functions, Loads, Globals int
	LOC, SLOC, Comments, Blanks          int
}

IndexTotals aggregates index counts across all files.

type IndexedFile

type IndexedFile struct {
	Path                        string
	Functions                   []IndexedFunction
	Loads                       []IndexedLoad
	Globals                     []IndexedGlobal
	LOC, SLOC, Comments, Blanks int
}

IndexedFile holds the index results for a single file.

type IndexedFunction

type IndexedFunction struct {
	Name         string
	Line         int
	Params       int
	HasDocstring bool
	Docstring    string
}

IndexedFunction describes a function definition found in a Starlark file.

type IndexedGlobal

type IndexedGlobal struct {
	Name string
	Line int
}

IndexedGlobal describes a top-level assignment found in a Starlark file.

type IndexedLoad

type IndexedLoad struct {
	Module string
	Names  []string
	Line   int
}

IndexedLoad describes a load statement found in a Starlark file.

type Provider

type Provider struct {
	op.ProviderBase
	Root string
}

Provider performs AST-based indexing of Starlark source files.

+devlore:access=immediate +devlore:bind Root=WorkDir

func (*Provider) IndexFiles

func (p *Provider) IndexFiles(files []string, withDocstrings, withGlobals bool) (*Index, error)

IndexFiles parses all files and extracts functions, loads, and globals. If withDocstrings is true, function docstrings are extracted. If withGlobals is true, top-level assignments are captured.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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