indexes

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WikilinkIndex

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

WikilinkIndex manages all wikilink targets across the workspace

func NewWikilinkIndex

func NewWikilinkIndex(logger *log.Logger) *WikilinkIndex

NewWikilinkIndex creates a new wikilink index

func (*WikilinkIndex) AddTarget

func (wi *WikilinkIndex) AddTarget(target, sourceURI string, exists bool)

AddTarget adds or updates a wikilink target in the index

func (*WikilinkIndex) AddTargetWithMatches

func (wi *WikilinkIndex) AddTargetWithMatches(target, sourceURI string, exists bool, matchingFiles []string)

AddTargetWithMatches adds or updates a wikilink target with conflict information

func (*WikilinkIndex) Clear

func (wi *WikilinkIndex) Clear()

Clear removes all targets from the index

func (*WikilinkIndex) ExtractWikilinksFromDocument

func (wi *WikilinkIndex) ExtractWikilinksFromDocument(content, documentURI string, workspaceFiles map[string]WorkspaceFile) []string

ExtractWikilinksFromDocument parses a document and extracts all wikilink targets using AST-based parsing

func (*WikilinkIndex) GetAllTargets

func (wi *WikilinkIndex) GetAllTargets() map[string]*WikilinkTargetInfo

GetAllTargets returns all wikilink targets, optionally filtered by existence

func (*WikilinkIndex) GetAmbiguousTargets

func (wi *WikilinkIndex) GetAmbiguousTargets() map[string]*WikilinkTargetInfo

GetAmbiguousTargets returns all targets that have multiple matching files

func (*WikilinkIndex) GetNonExistentTargets

func (wi *WikilinkIndex) GetNonExistentTargets() map[string]*WikilinkTargetInfo

GetNonExistentTargets returns all targets that don't correspond to existing files

func (*WikilinkIndex) GetReferenceCount

func (wi *WikilinkIndex) GetReferenceCount(target string) int

GetReferenceCount returns the number of documents that reference a target

func (*WikilinkIndex) GetTargetsByPrefix

func (wi *WikilinkIndex) GetTargetsByPrefix(prefix string) map[string]*WikilinkTargetInfo

GetTargetsByPrefix returns targets that start with the given prefix

func (wi *WikilinkIndex) RefreshDocumentWikilinks(content, documentURI string, workspaceFiles map[string]WorkspaceFile)

RefreshDocumentWikilinks removes old wikilink references for a document and re-extracts them

func (*WikilinkIndex) RemoveTargetReference

func (wi *WikilinkIndex) RemoveTargetReference(target, sourceURI string)

RemoveTargetReference removes a reference to a target from a specific document

func (*WikilinkIndex) UpdateTargetExistence

func (wi *WikilinkIndex) UpdateTargetExistence(target string, exists bool)

UpdateTargetExistence updates whether a target exists based on file system changes

type WikilinkTargetInfo

type WikilinkTargetInfo struct {
	Target        string          // The wikilink target (e.g., "project-alpha", "docs/api")
	Exists        bool            // Whether the target file actually exists
	ReferencedBy  map[string]bool // Set of document URIs that reference this target
	LastSeen      time.Time       // When this target was last seen during scanning
	SuggestedURI  string          // Suggested file URI if this target were to be created
	MatchingFiles []string        // All files that match this target (for conflict detection)
	IsAmbiguous   bool            // Whether this target has multiple matching files
}

WikilinkTargetInfo contains information about a wikilink target

type WorkspaceFile

type WorkspaceFile interface {
	GetURI() string
	GetPath() string
}

WorkspaceFile represents basic file information for workspace operations

Jump to

Keyboard shortcuts

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