Skip to main content

Module file_index

Module file_index 

Source
Expand description

One working tree’s files, and the ranking the @ trigger reads a query against.

The walk is forge_agent::env::file_index’s and the shape is here because the readers are not one: a view’s mention list and the seat’s own loop, which walks it and pushes the whole index as FileIndexChanged. The walk itself stays where it was, with the rest of the environment’s I/O.

Re-exports§

use std::collections::BTreeMap; 🔒
use std::path::Path; 🔒

Structs§

FileCandidate
FileIndex
The files under one root, keyed by their path relative to it.

Functions§

match_tier 🔒
How well candidate matches, smaller being better. An empty query matches everything equally, which is what a bare @ shows.
rank_and_truncate_candidates
Best match first, then shallowest, then alphabetically, cut to limit.
respect_gitignore
Whether a walk honours gitignore, from the CLI’s per-user preferences document: its respectGitignore key, absent or not a boolean reading as true, which is the CLI’s own default. Every view reads the key here, so none can drift on how it is read.