M2.5: symbol index and go-to commands
crates/index: walks the project with the search/VFS rules (vendor as library), parses .php files from tree-sitter outlines on a worker pool off the engine lock, updates incrementally from disk and buffers through an updater thread, caps at 200,000 files, and answers fuzzy file, class and symbol queries (nucleo-matcher, MPL-2.0 as a separate crate). Engine: index.status, goto.file, goto.class, goto.symbol; events indexProgress and indexReady drained by the pump; the index starts on project.open and is cancelled on close. Tests: unit, incremental, property (random queries and sources), engine and TCP control tests, release timing on a generated 20k-file project (3.9-4.2 s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f13a49064d
commit
053441d066
26 changed files with 3455 additions and 9 deletions
|
|
@ -131,7 +131,8 @@ impl Engine {
|
|||
/// Applies pending changes on disk (reloads clean buffers, reports
|
||||
/// changed directories and conflicts), writes due recovery-journal
|
||||
/// entries (see [`crate::journal`]), moves finished search results into
|
||||
/// events (see [`cmd::search`]) and returns every queued event.
|
||||
/// events (see [`cmd::search`]), merges index updates (see
|
||||
/// [`cmd::goto`]) and returns every queued event.
|
||||
/// Hosts call it regularly, e.g. every 100 ms from a background thread.
|
||||
///
|
||||
/// # Errors
|
||||
|
|
@ -143,6 +144,7 @@ impl Engine {
|
|||
crate::workspace::pump(state);
|
||||
crate::journal::tick(state, std::time::Instant::now());
|
||||
cmd::search::pump(state);
|
||||
cmd::goto::sync(state);
|
||||
Ok(())
|
||||
})?;
|
||||
Ok(state.take_events())
|
||||
|
|
@ -368,6 +370,10 @@ mod tests {
|
|||
"file.open",
|
||||
"file.save",
|
||||
"file.saveAll",
|
||||
"goto.class",
|
||||
"goto.file",
|
||||
"goto.symbol",
|
||||
"index.status",
|
||||
"project.children",
|
||||
"project.close",
|
||||
"project.open",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue