Help us shape the future of Go! Take the 2026 Go Developer Survey

languages

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package languages provides syntax-only adapters backed by upstream Tree-sitter grammars.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Capability() Capability
	Parse(context.Context, Source) (Result, error)
}

func ForPath

func ForPath(path string) (Adapter, bool)

type Capability

type Capability struct {
	Language   string `json:"language"`
	Structural bool   `json:"structural"`
	Semantic   bool   `json:"semantic"`
	Method     string `json:"method"`
}

func Capabilities

func Capabilities() []Capability

type Import

type Import struct {
	Language string
	Module   string
	Names    []string
	Line     int
}

Import is one import specifier as written in a source file. Names lists imported members, which may themselves be submodules (Python `from . import x`).

type Result

type Result struct {
	Nodes       []model.Node
	Edges       []model.Edge
	Diagnostics []model.Diagnostic
	// Imports keeps raw specifiers for later repository-level path resolution.
	Imports []Import
}

type Source

type Source struct {
	Repository, Revision, Path string
	Content                    []byte
}

Jump to

Keyboard shortcuts

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