atmention

package
v2026.701.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxFileExpandBytes = 32 * 1024
View Source
const MaxIncludeDepth = 4
View Source
const MaxPickerResults = 10

Variables

This section is empty.

Functions

func DeleteTagAt

func DeleteTagAt(line []rune, pos int) ([]rune, int, bool)

func DeleteTagForward

func DeleteTagForward(line []rune, pos int) ([]rune, int, bool)

func ExpandDocument added in v2026.621.0

func ExpandDocument(ctx context.Context, text, sourceAbsPath, projRoot string, notify *Notifier) (string, error)

func ExpandDocumentWithMax added in v2026.621.0

func ExpandDocumentWithMax(ctx context.Context, text, sourceAbsPath, projRoot string, maxFileBytes int64, notify *Notifier) (string, error)

func ExpandLine

func ExpandLine(ctx context.Context, visible, projRoot string, index []Entry) (apiContent string, err error)

func JumpLeftOverTag

func JumpLeftOverTag(line []rune, pos int) int

func JumpRightOverTag

func JumpRightOverTag(line []rune, pos int) int

func ResolveDocumentPath added in v2026.621.0

func ResolveDocumentPath(tagPath, baseDir string) (abs string, err error)

func ShortTag

func ShortTag(relPath string, all []Entry) string

Types

type AtContext

type AtContext struct {
	Active       bool
	AtStart      int
	QueryStart   int
	Query        string
	ReplaceStart int
}

func AtContextAt

func AtContextAt(line []rune, col int) AtContext

type DocumentOpts added in v2026.621.0

type DocumentOpts struct {
	ProjRoot     string
	BaseDir      string
	SourcePath   string
	MaxFileBytes int64
	Notify       *Notifier
	Depth        int
	Visited      map[string]struct{}
}

type DocumentTag added in v2026.621.0

type DocumentTag struct {
	Start int
	End   int
	Path  string
}

func FindDocumentTags added in v2026.621.0

func FindDocumentTags(s string) []DocumentTag

type Entry

type Entry struct {
	RelPath string
	IsDir   bool
}

func BuildIndex

func BuildIndex(ctx context.Context, root string) ([]Entry, error)

func MatchQuery

func MatchQuery(query string, all []Entry, limit int) []Entry

func ResolveTag

func ResolveTag(tag string, all []Entry) (Entry, bool)

type Index

type Index struct {
	Root     string
	Entries  []Entry
	LoadedAt time.Time
}

type IndexCache

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

func NewIndexCache

func NewIndexCache() *IndexCache

func (*IndexCache) Get

func (c *IndexCache) Get(ctx context.Context, projRoot string) ([]Entry, error)

func (*IndexCache) Invalidate

func (c *IndexCache) Invalidate(projRoot string)

type Notifier added in v2026.621.0

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

func NewNotifier added in v2026.621.0

func NewNotifier() *Notifier

func (*Notifier) Add added in v2026.621.0

func (n *Notifier) Add(reason SkipReason, tag, path string)

func (*Notifier) Merge added in v2026.621.0

func (n *Notifier) Merge(other *Notifier)

func (*Notifier) Messages added in v2026.621.0

func (n *Notifier) Messages() []string

type RuneBounds

type RuneBounds struct {
	Start int
	End   int
}

func TagRuneBounds

func TagRuneBounds(line []rune) []RuneBounds

type SkipNotice added in v2026.621.0

type SkipNotice struct {
	Reason SkipReason
	Tag    string
	Path   string
}

type SkipReason added in v2026.621.0

type SkipReason string
const (
	SkipMissing    SkipReason = "missing"
	SkipGitignored SkipReason = "gitignored"
	SkipBinary     SkipReason = "binary"
	SkipExternal   SkipReason = "external"
	SkipDepth      SkipReason = "depth"
	SkipCycle      SkipReason = "cycle"
	SkipNotText    SkipReason = "not_text"
)

Jump to

Keyboard shortcuts

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