Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBuffer ¶ added in v0.2.0
FormatBuffer formats source code in-memory based on file extension. Go files use gofumpt; HCL/Terraform files use hclwrite.Format. Python files use ruff (preferred) or black. TypeScript/JavaScript files use prettier. Returns the formatted buffer, or the original buffer unchanged if the file type has no formatter or formatting fails.
func LanguageForPath ¶ added in v0.2.0
LanguageForPath maps file extensions to tree-sitter languages. Single source of truth — used by Validate, ASTErrors, and ingest.ReExtractContext.
Types ¶
type ValidationError ¶ added in v0.2.0
type ValidationError struct {
FilePath string
Line uint32 // 0-indexed
Column uint32 // 0-indexed
Message string
}
ValidationError contains structured information about a syntax error.
func ASTErrors ¶ added in v0.2.0
func ASTErrors(content []byte, filePath string) []ValidationError
ASTErrors returns all ERROR node locations in the content for diagnostic reporting. Returns nil if no errors or unknown language.
func (*ValidationError) Error ¶ added in v0.2.0
func (e *ValidationError) Error() string