First pass on fixes

This commit is contained in:
Piotr Osiewicz 2025-08-19 14:23:59 +02:00
parent 5826d89b97
commit 2f3be75fc7
269 changed files with 1593 additions and 2574 deletions

View file

@ -194,12 +194,11 @@ impl EmbeddingIndex {
project::PathChange::Added
| project::PathChange::Updated
| project::PathChange::AddedOrUpdated => {
if let Some(entry) = worktree.entry_for_id(*entry_id) {
if entry.is_file() {
if let Some(entry) = worktree.entry_for_id(*entry_id)
&& entry.is_file() {
let handle = entries_being_indexed.insert(entry.id);
updated_entries_tx.send((entry.clone(), handle)).await?;
}
}
}
project::PathChange::Removed => {
let db_path = db_key_for_path(path);

View file

@ -384,11 +384,10 @@ impl ProjectIndex {
cx: &App,
) -> Option<Entity<WorktreeIndex>> {
for index in self.worktree_indices.values() {
if let WorktreeIndexHandle::Loaded { index, .. } = index {
if index.read(cx).worktree().read(cx).id() == worktree_id {
if let WorktreeIndexHandle::Loaded { index, .. } = index
&& index.read(cx).worktree().read(cx).id() == worktree_id {
return Some(index.clone());
}
}
}
None
}

View file

@ -174,15 +174,13 @@ impl SemanticDb {
file_content[start_line_byte_offset..end_line_byte_offset].to_string();
LineEnding::normalize(&mut excerpt_content);
if let Some(prev_result) = loaded_results.last_mut() {
if prev_result.full_path == full_path {
if *prev_result.row_range.end() + 1 == start_row {
if let Some(prev_result) = loaded_results.last_mut()
&& prev_result.full_path == full_path
&& *prev_result.row_range.end() + 1 == start_row {
prev_result.row_range = *prev_result.row_range.start()..=end_row;
prev_result.excerpt_content.push_str(&excerpt_content);
continue;
}
}
}
loaded_results.push(LoadedSearchResult {
path: result.path,

View file

@ -379,8 +379,8 @@ impl SummaryIndex {
| project::PathChange::Added
| project::PathChange::Updated
| project::PathChange::AddedOrUpdated => {
if let Some(entry) = worktree.entry_for_id(*entry_id) {
if entry.is_file() {
if let Some(entry) = worktree.entry_for_id(*entry_id)
&& entry.is_file() {
let needs_summary = Self::add_to_backlog(
Arc::clone(&backlog),
digest_db,
@ -392,7 +392,6 @@ impl SummaryIndex {
tx.send(needs_summary).await?;
}
}
}
}
project::PathChange::Removed => {
let _db_path = db_key_for_path(path);