pub struct GraphIndexer { /* private fields */ }Expand description
Background indexer that walks a project directory, parses source files
with tree-sitter, extracts symbols and call edges, and populates a
shared CodeGraph.
Implementations§
Source§impl GraphIndexer
impl GraphIndexer
Sourcepub fn new(graph: Arc<RwLock<CodeGraph>>, project_dir: PathBuf) -> Self
pub fn new(graph: Arc<RwLock<CodeGraph>>, project_dir: PathBuf) -> Self
Create a new indexer for the given project directory.
Sourcepub async fn index_all(&mut self, cancel: CancellationToken)
pub async fn index_all(&mut self, cancel: CancellationToken)
Full/incremental index pass.
- Collect files via
ignore::WalkBuilder(respects .gitignore) - Compare mtimes — only parse dirty/new files
- Detect deleted files — remove from graph
- Parse dirty files, extract symbols and calls
- Resolve calls to edges
cancel is checked at every point where abandoning is cheap: top
of the fn, between parse-file iterations (the expensive step),
and before the final write-lock mutation block. Cancellation is
cooperative — the sync WalkBuilder inside spawn_blocking
cannot itself be interrupted, so best we can do is skip the
parsing and mutation phases if cancel fires mid-walk. Rapid /cd
chains depend on this: without it, each cd spawns a fresh
indexer and all of them parse in parallel.
Sourcepub async fn reindex_file(&mut self, path: &Path)
pub async fn reindex_file(&mut self, path: &Path)
Re-index a single file (for live updates after edit).
Auto Trait Implementations§
impl Freeze for GraphIndexer
impl !RefUnwindSafe for GraphIndexer
impl Send for GraphIndexer
impl Sync for GraphIndexer
impl Unpin for GraphIndexer
impl UnsafeUnpin for GraphIndexer
impl !UnwindSafe for GraphIndexer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more