chunk

package
v0.0.0-...-6320ad3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkVisitor

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

ChunkVisitor implements SyntaxTreeVisitor for hierarchical code chunking It creates chunks at file, class, function, and block levels

func NewChunkVisitor

func NewChunkVisitor(logger *zap.Logger, language, filePath string, sourceCode []byte, minConditionalLines, minLoopLines int) *ChunkVisitor

NewChunkVisitor creates a new chunk visitor

func (*ChunkVisitor) GetChunks

func (cv *ChunkVisitor) GetChunks() []*model.CodeChunk

GetChunks returns all collected code chunks

func (*ChunkVisitor) TraverseNode

func (cv *ChunkVisitor) TraverseNode(ctx context.Context, tsNode *tree_sitter.Node, scopeID any) any

TraverseNode is the main entry point for traversing syntax tree nodes

Jump to

Keyboard shortcuts

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