diff --git a/app/buck2_cmd_completion_client/src/complete/package.rs b/app/buck2_cmd_completion_client/src/complete/package.rs index 092052c944ff..5be1d15ed315 100644 --- a/app/buck2_cmd_completion_client/src/complete/package.rs +++ b/app/buck2_cmd_completion_client/src/complete/package.rs @@ -63,7 +63,7 @@ impl<'a> PackageCompleter<'a> { let cwd_cell_name = self .cell_configs .cell_resolver - .get_cell_path_from_abs_path(self.cwd.path().as_abs_path(), &self.roots.project_root)? + .get_cell_path(&self.roots.cwd)? .cell(); let cwd_cell_root = self.cell_configs.cell_resolver.get(cwd_cell_name)?.path(); let cwd_cell_root = self.roots.project_root.resolve(cwd_cell_root); @@ -97,10 +97,7 @@ impl<'a> PackageCompleter<'a> { let cell_resolver = &self.cell_configs.cell_resolver; let alias_resolver = self .cell_configs - .get_cell_alias_resolver_for_cwd_fast( - &self.roots.project_root, - &self.roots.project_root.relativize(self.cwd.path())?, - ) + .get_cell_alias_resolver_for_cwd_fast(&self.roots.project_root, &self.roots.cwd) .await?; for (cell_alias, cell_name) in alias_resolver.mappings() { let canonical_cell_root = format!("{}//", cell_alias); diff --git a/app/buck2_cmd_completion_client/src/complete/path_sanitizer.rs b/app/buck2_cmd_completion_client/src/complete/path_sanitizer.rs index 81d34dec9c59..1091cc6f1f53 100644 --- a/app/buck2_cmd_completion_client/src/complete/path_sanitizer.rs +++ b/app/buck2_cmd_completion_client/src/complete/path_sanitizer.rs @@ -115,7 +115,7 @@ impl PathSanitizer { self.cwd.path().join_normalized(path_str)? }; - let cwd_cell_name = self.resolve_cell(self.cwd.path())?; + let cwd_cell_name = self.cell_resovler.find(&self.cwd_roots.cwd)?; let cell_name = self.resolve_cell(&abs_path)?; let cell_path = self.relative_to_cell(&abs_path)?; @@ -149,7 +149,7 @@ impl PathSanitizer { cell_path: &str, ) -> Result { let given_cell = if given_cell_str == "" { - self.resolve_cell(self.cwd.path())? + self.cell_resovler.find(&self.cwd_roots.cwd)? } else { self.resolve_alias(given_cell_str)? };