fileref

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package fileref implements context/file-reference @ mentions: find the token at the cursor and format selected paths as @path or @"path".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMention

func FormatMention(path string, isDir, preserveQuote bool) string

FormatMention formats a selected path, retaining directory slashes and quoting whitespace. It returns empty when the syntax cannot safely represent the path.

Types

type Token

type Token struct {
	Prefix string // The complete token to replace.
	Query  string // Path query following @.
	Quoted bool   // Whether the path is quoted.
}

Token describes the active @ token at the cursor.

func ActiveAtToken

func ActiveAtToken(line string, cursorCol int) (Token, bool)

ActiveAtToken extracts an @path or quoted token before the cursor, or returns false.

Jump to

Keyboard shortcuts

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