agent: Fix file context renames affecting display + simplify loading code (#29192)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-04-21 21:16:46 -06:00 committed by GitHub
parent dfbd132d9f
commit 19ef56ba7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 106 additions and 145 deletions

View file

@ -241,7 +241,7 @@ impl AddedContext {
pub fn new(context: &AssistantContext, cx: &App) -> AddedContext {
match context {
AssistantContext::File(file_context) => {
let full_path = file_context.context_buffer.file.full_path(cx);
let full_path = file_context.context_buffer.full_path(cx);
let full_path_string: SharedString =
full_path.to_string_lossy().into_owned().into();
let name = full_path
@ -304,7 +304,7 @@ impl AddedContext {
},
AssistantContext::Excerpt(excerpt_context) => {
let full_path = excerpt_context.context_buffer.file.full_path(cx);
let full_path = excerpt_context.context_buffer.full_path(cx);
let mut full_path_string = full_path.to_string_lossy().into_owned();
let mut name = full_path
.file_name()