repomap

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package repomap draws a ranked map of a repository's definitions, as Aider's repo map does, so a model can find its way in a large codebase. Go files are parsed with go/parser, other languages lexed with chroma.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Supported

func Supported(rel string) bool

Supported reports whether the map reads a file, by its slash path: one in a known language, not vendored, a test fixture or minified.

Types

type File

type File struct {
	Path    string
	Size    int64
	ModTime time.Time
}

File is a source file to map, by its slash path below the root, with the size and modification time that key its cached tags.

type Mapper

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

Mapper keeps the tags of recently mapped directories, so a map of an unchanged tree reads no file again; safe for concurrent use.

func (*Mapper) Map

func (m *Mapper) Map(ctx context.Context, req Request) (Result, error)

Map draws the map Request asks for.

type Request

type Request struct {
	Root         string
	Files        []File
	FocusFiles   []string
	FocusSymbols []string
	Tokens       int
}

Request asks for the map of Files below Root. FocusFiles (slash paths below Root) are the files the work is about: what they use ranks higher and they are left out of the map. FocusSymbols are identifiers the work names. Tokens is the map's budget, 2048 when zero.

type Result

type Result struct {
	Text   string
	Tokens int
	Shown  int
	Mapped int
}

Result is a drawn map: its text, about Tokens long, showing Shown of the Mapped files that hold definitions.

Jump to

Keyboard shortcuts

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