mention

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package mention implements @-prefixed file mentions in prompt input, enabling users to reference project files that get auto-included as context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPartial

func ExtractPartial(input string, cursorPos int) string

ExtractPartial extracts the partial path being typed after @ for completion.

func FuzzyMatch

func FuzzyMatch(partial string, projectRoot string, maxResults int) []string

FuzzyMatch performs fuzzy matching of a partial path against the project file tree. Returns up to maxResults matching paths, sorted by relevance.

func IsMention

func IsMention(token string) bool

IsMention returns true if the token starts with @.

Types

type ParseResult

type ParseResult struct {
	CleanInput     string   // Input with mentions removed
	MentionedFiles []string // Resolved file paths
	RawMentions    []string // Original mention strings as typed
}

ParseResult holds the output of parsing mentions from input.

func ParseMentions

func ParseMentions(input string, projectRoot string) ParseResult

ParseMentions extracts @-prefixed file mentions from the input string. Returns the cleaned input (without mention tokens) and the list of mentioned file paths.

Jump to

Keyboard shortcuts

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