treeanalyzer

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package treeanalyzer extracts conservative, language-neutral code structure with the pure-Go Tree-sitter runtime. Language-specific analyzers remain the authority when one is registered (notably Go, Markdown, and SQL).

Index

Constants

View Source
const InternalWorkerCommand = "__tree-analyzer-worker"

InternalWorkerCommand is intentionally omitted from the public CLI help. The parent Ravel process uses it to isolate Tree-sitter runtimes and their process-wide parser state.

Variables

This section is empty.

Functions

func RunProcessWorker added in v0.2.6

func RunProcessWorker(ctx context.Context, input io.Reader, output io.Writer) error

RunProcessWorker serves the hidden single-threaded parser process protocol. It is exported only so the CLI package can route the hidden command without creating a package cycle.

func Supports

func Supports(language string, files []scan.File) bool

Supports reports whether at least one file can be mapped to an embedded grammar. Filename detection is preferred because it distinguishes TSX and other extension-specific grammar variants.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

func New

func New(language string) *Analyzer

func NewWithJobs added in v0.2.7

func NewWithJobs(language string, jobs int) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(ctx context.Context, _ string, files []scan.File) (*lang.AnalysisResult, error)

func (*Analyzer) AnalyzeWithFileCache added in v0.2.7

func (a *Analyzer) AnalyzeWithFileCache(ctx context.Context, _ string, files []scan.File, progress func(path string, completed int), cache lang.FileAnalysisCache) (*lang.AnalysisResult, error)

func (*Analyzer) AnalyzeWithProgress added in v0.2.4

func (a *Analyzer) AnalyzeWithProgress(ctx context.Context, _ string, files []scan.File, progress func(path string, completed int)) (*lang.AnalysisResult, error)

func (*Analyzer) Extensions

func (a *Analyzer) Extensions() []string

Extensions are supplied by gotreesitter's grammar registry. Ravel dispatches already-audited files by their scanner language, so this method is metadata.

func (*Analyzer) Language

func (a *Analyzer) Language() string

Jump to

Keyboard shortcuts

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