mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 12:38:02 +00:00
add handling for Added file events to semantic index
This commit is contained in:
parent
a892a51ec3
commit
131950f670
1 changed files with 4 additions and 3 deletions
|
@ -728,9 +728,9 @@ impl SemanticIndex {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log::trace!("File Event: {:?}, Path: {:?}", &path_change, &path);
|
||||||
match path_change {
|
match path_change {
|
||||||
PathChange::AddedOrUpdated | PathChange::Updated => {
|
PathChange::AddedOrUpdated | PathChange::Updated | PathChange::Added => {
|
||||||
log::trace!("File Updated: {:?}", path);
|
|
||||||
if let Ok(language) = language_registry
|
if let Ok(language) = language_registry
|
||||||
.language_for_file(&relative_path, None)
|
.language_for_file(&relative_path, None)
|
||||||
.await
|
.await
|
||||||
|
@ -786,6 +786,7 @@ impl SemanticIndex {
|
||||||
project: ModelHandle<Project>,
|
project: ModelHandle<Project>,
|
||||||
cx: &mut ModelContext<Self>,
|
cx: &mut ModelContext<Self>,
|
||||||
) -> Task<Result<()>> {
|
) -> Task<Result<()>> {
|
||||||
|
log::trace!("Initializing Project for Semantic Index");
|
||||||
let worktree_scans_complete = project
|
let worktree_scans_complete = project
|
||||||
.read(cx)
|
.read(cx)
|
||||||
.worktrees(cx)
|
.worktrees(cx)
|
||||||
|
@ -807,7 +808,7 @@ impl SemanticIndex {
|
||||||
|
|
||||||
let _subscription = cx.subscribe(&project, |this, project, event, cx| {
|
let _subscription = cx.subscribe(&project, |this, project, event, cx| {
|
||||||
if let project::Event::WorktreeUpdatedEntries(worktree_id, changes) = event {
|
if let project::Event::WorktreeUpdatedEntries(worktree_id, changes) = event {
|
||||||
this.project_entries_changed(project, changes.clone(), cx, worktree_id);
|
this.project_entries_changed(project.clone(), changes.clone(), cx, worktree_id);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue