agent: Make directory context display update on rename (#29189)
Release Notes: - N/A
This commit is contained in:
parent
c15382c4d8
commit
2e8ee9b64f
5 changed files with 74 additions and 31 deletions
|
@ -264,10 +264,14 @@ impl AddedContext {
|
|||
}
|
||||
|
||||
AssistantContext::Directory(directory_context) => {
|
||||
let full_path = directory_context
|
||||
.worktree
|
||||
.read(cx)
|
||||
.full_path(&directory_context.path);
|
||||
let worktree = directory_context.worktree.read(cx);
|
||||
// If the directory no longer exists, use its last known path.
|
||||
let full_path = worktree
|
||||
.entry_for_id(directory_context.entry_id)
|
||||
.map_or_else(
|
||||
|| directory_context.last_path.clone(),
|
||||
|entry| worktree.full_path(&entry.path).into(),
|
||||
);
|
||||
let full_path_string: SharedString =
|
||||
full_path.to_string_lossy().into_owned().into();
|
||||
let name = full_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue