ast

package
v0.104.1 Latest Latest
Warning

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

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

Documentation

Overview

Package ast provides a lightweight structural outline of source files for LLM consumption. It uses gotreesitter (pure Go, no CGo) to parse source files and extract symbols. This package is isolated so the gotreesitter dependency can be replaced without affecting the rest of the codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Path     string
	Language string
	Symbols  []Symbol
}

File holds the parsed outline of a source file.

func Parse

func Parse(filePath string) (*File, error)

Parse reads filePath, detects its language, and returns a structural outline.

type Symbol

type Symbol struct {
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Signature string `json:"signature"`
	Line      int    `json:"line"` // 1-indexed
}

Symbol is a structural element extracted from a source file.

Jump to

Keyboard shortcuts

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