Clean up RelPath API (#38912)

Consolidate constructors and accessors.

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
Max Brunsfeld
2025-09-25 14:42:32 -07:00
committed by GitHub
co-authored by Cole Miller
parent 301e976465
commit 495a7b0a84
70 changed files with 483 additions and 408 deletions
+5 -5
View File
@@ -608,7 +608,7 @@ async fn test_running_multiple_instances_of_a_single_server_in_one_worktree(
}: ManifestQuery,
) -> Option<Arc<RelPath>> {
for path in path.ancestors().take(depth) {
let p = path.join(RelPath::new("pyproject.toml").unwrap());
let p = path.join(rel_path("pyproject.toml"));
if delegate.exists(&p, Some(false)) {
return Some(path.into());
}
@@ -737,7 +737,7 @@ async fn test_running_multiple_instances_of_a_single_server_in_one_worktree(
})
.await
.expect("A toolchain to be discovered");
assert_eq!(root_path.as_ref(), RelPath::new("project-b").unwrap());
assert_eq!(root_path.as_ref(), rel_path("project-b"));
assert_eq!(available_toolchains_for_b.toolchains().len(), 1);
let currently_active_toolchain = project
.update(cx, |this, cx| {
@@ -1285,7 +1285,7 @@ async fn test_reporting_fs_changes_to_language_servers(cx: &mut gpui::TestAppCon
.read(cx)
.snapshot()
.entries(true, 0)
.map(|entry| (entry.path.as_str(), entry.is_ignored))
.map(|entry| (entry.path.as_unix_str(), entry.is_ignored))
.collect::<Vec<_>>(),
&[
("", false),
@@ -1403,7 +1403,7 @@ async fn test_reporting_fs_changes_to_language_servers(cx: &mut gpui::TestAppCon
.read(cx)
.snapshot()
.entries(true, 0)
.map(|entry| (entry.path.as_str(), entry.is_ignored))
.map(|entry| (entry.path.as_unix_str(), entry.is_ignored))
.collect::<Vec<_>>(),
&[
("", false),
@@ -9336,7 +9336,7 @@ fn python_lang(fs: Arc<FakeFs>) -> Arc<Language> {
let ancestors = subroot_relative_path.ancestors().collect::<Vec<_>>();
let mut toolchains = vec![];
for ancestor in ancestors {
let venv_path = worktree_root.join(ancestor).join(".venv");
let venv_path = worktree_root.join(ancestor.as_std_path()).join(".venv");
if self.0.is_dir(&venv_path).await {
toolchains.push(Toolchain {
name: SharedString::new("Python Venv"),