Use worktree qualified paths in agent file context + some code cleanup (#27943)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-04-02 12:00:32 -06:00 committed by GitHub
parent 142f9917d0
commit b7b7f1ccdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 53 additions and 99 deletions

View file

@ -63,9 +63,9 @@ use gpui::{
};
use itertools::Itertools;
use language::{
Buffer, BufferEvent, Capability, CodeLabel, File as _, Language, LanguageName,
LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList, Transaction,
Unclipped, language_settings::InlayHintKind, proto::split_operations,
Buffer, BufferEvent, Capability, CodeLabel, Language, LanguageName, LanguageRegistry,
PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList, Transaction, Unclipped,
language_settings::InlayHintKind, proto::split_operations,
};
use lsp::{
CodeActionKind, CompletionContext, CompletionItemKind, DocumentHighlightKind, LanguageServerId,
@ -4990,7 +4990,7 @@ impl ProjectItem for Buffer {
}
fn project_path(&self, cx: &App) -> Option<ProjectPath> {
File::from_dyn(self.file()).map(|file| ProjectPath {
self.file().map(|file| ProjectPath {
worktree_id: file.worktree_id(cx),
path: file.path().clone(),
})