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

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2025-04-22 03:16:46 +00:00
committed by GitHub
parent dfbd132d9f
commit 19ef56ba7c
3 changed files with 106 additions and 145 deletions
+2 -2
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()