Skip to main content

Module Search

Module Search 

Source
Expand description

Search handlers - find in files, find files by glob.

Both handlers now delegate to the properly-implemented trait methods on MountainEnvironment instead of carrying their own inline fs-walk. The inline versions used naive starts_with('.') hidden-file skipping (doesn’t honour .gitignore), no regex engine, a bogus format!("file://{}", path) URI constructor, and a single- threaded walker. The trait impls live in:

  • Environment/SearchProvider.rs (TextSearch) - grep-searcher + RegexMatcherBuilder + ignore::WalkBuilder::build_parallel() with PerFileSink collection.
  • Environment/WorkspaceProvider.rs (FindFilesInWorkspace) - ignore-aware glob walker with .gitignore support, max-result cap, symlink handling, and proper Url::from_file_path URI construction.

This wiring was the “lot of dead code that needs to be connected” the user flagged - the trait impls were reachable only through Environment.Require<dyn SearchProvider>() / WorkspaceProvider calls and no IPC handler ever issued those calls.

Functions§

SearchFindFiles
search:findFiles / search:fileSearch / search:searchFile.
SearchFindInFiles
search:findInFiles / search:textSearch / search:searchText.