update_file_incremental

Function update_file_incremental 

Source
pub fn update_file_incremental(
    index: &mut SemanticIndex,
    project_root: &Path,
    path: &Path,
    content: &str,
) -> IncrementalUpdateResult
Expand description

Update a single file in an existing SemanticIndex.

This performs an incremental update:

  1. Remove all data for the old version of the file (if it exists)
  2. Re-extract the file
  3. Add the new symbols, tokens, references, scopes
  4. Re-resolve edges for the new symbols

This is much faster than rebuilding the entire index (~20-50ms per file).

§Arguments

  • index - The existing SemanticIndex to update
  • project_root - Project root path for computing relative paths
  • path - Path to the file to update
  • content - New content of the file

§Returns

Statistics about the update operation