Skip to content

Commit 371fe76

Browse files
committed
fix(load-cargo): load workspace from relative path
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
1 parent dd2354c commit 371fe76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/load-cargo/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ pub enum ProcMacroServerChoice {
3939
}
4040

4141
pub fn load_workspace_at(
42-
root: &Path,
42+
root: impl AsRef<Path>,
4343
cargo_config: &CargoConfig,
4444
load_config: &LoadCargoConfig,
4545
progress: &dyn Fn(String),
4646
) -> anyhow::Result<(RootDatabase, vfs::Vfs, Option<ProcMacroClient>)> {
47-
let root = AbsPathBuf::assert_utf8(std::env::current_dir()?.join(root));
47+
let root = AbsPathBuf::assert_utf8(root.as_ref().canonicalize()?);
4848
let root = ProjectManifest::discover_single(&root)?;
4949
let manifest_path = root.manifest_path().clone();
5050
let mut workspace = ProjectWorkspace::load(root, cargo_config, progress)?;

0 commit comments

Comments
 (0)