Skip to content

Commit 2d544f1

Browse files
author
liv
committed
fix: revert back to using relative paths
1 parent 0667ee7 commit 2d544f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/project.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use glob::glob;
22
use serde::{Deserialize, Serialize};
3+
use std::env;
34
use std::error::Error;
45
use std::path::PathBuf;
56
use std::process::Command;
6-
use std::{env, fs};
77

88
/// Contains the structure of resulting rust-project.json file
99
/// and functions to build the data required to create the file
@@ -42,9 +42,8 @@ impl RustAnalyzerProject {
4242
fn path_to_json(&mut self, path: PathBuf) -> Result<(), Box<dyn Error>> {
4343
if let Some(ext) = path.extension() {
4444
if ext == "rs" {
45-
let abspath = fs::canonicalize(path)?;
4645
self.crates.push(Crate {
47-
root_module: abspath.display().to_string(),
46+
root_module: path.display().to_string(),
4847
edition: "2021".to_string(),
4948
deps: Vec::new(),
5049
// This allows rust_analyzer to work inside #[test] blocks

0 commit comments

Comments
 (0)