mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
agent: Derive project skill relative path via PathStyle
This commit is contained in:
parent
fae2278003
commit
175349cfde
1 changed files with 6 additions and 5 deletions
|
|
@ -3148,11 +3148,12 @@ pub fn skill_body_resolver_for_project(
|
|||
.context("no such worktree")?;
|
||||
expand_project_skills_directories(&worktree, cx).await?;
|
||||
let relative_path = worktree.update(cx, |worktree, _cx| {
|
||||
let relative_path = skill
|
||||
.skill_file_path
|
||||
.strip_prefix(worktree.abs_path())
|
||||
.context("skill file is not inside its worktree")?;
|
||||
anyhow::Ok(RelPath::new(relative_path, worktree.path_style())?.into_arc())
|
||||
let worktree_root = worktree.abs_path();
|
||||
worktree
|
||||
.path_style()
|
||||
.strip_prefix(&skill.skill_file_path, &worktree_root)
|
||||
.map(|relative_path| relative_path.into_arc())
|
||||
.context("skill file is not inside its worktree")
|
||||
})?;
|
||||
|
||||
let buffer = project
|
||||
|
|
|
|||
Loading…
Reference in a new issue