anchorstore

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package anchorstore tracks per-session line anchors for file reads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorStore

type AnchorStore = Store

AnchorStore is the public store type used by anchor-aware tools.

type Store

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

Store keeps the current anchor assignment for each path.

func New

func New() *Store

New returns an empty Store.

func (*Store) Assign

func (s *Store) Assign(path string, fileOffset int, lines []string)

Assign replaces path's anchor map for lines starting at fileOffset.

func (*Store) Invalidate

func (s *Store) Invalidate(path string)

Invalidate clears path's anchor assignments.

func (*Store) Lookup

func (s *Store) Lookup(path string, anchor string) (int, bool)

Lookup returns anchor's line for path.

Results are encoded as:

  • unique match: line, false
  • ambiguous match: -1, true
  • not found: -1, false

func (*Store) Resolve

func (s *Store) Resolve(path string, anchor string) ([]int, int, bool)

Resolve returns all known candidate lines for anchor on path and the number of lines covered by the current assignment.

Jump to

Keyboard shortcuts

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