Giter Club home page Giter Club logo

Comments (1)

brt-adam-snaider avatar brt-adam-snaider commented on July 23, 2024

Fyi, I'm using this patch to get around this. Not sure if this is something we'll want to merge in

diff --git a/rust/private/rust_analyzer.bzl b/rust/private/rust_analyzer.bzl
index 3eea6c08..e2111671 100644
--- a/rust/private/rust_analyzer.bzl
+++ b/rust/private/rust_analyzer.bzl
@@ -204,10 +204,9 @@ def _create_single_crate(ctx, info):
     # TODO: Some folks may want to override this for vendored dependencies.
     is_external = info.crate.root.path.startswith("external/")
     is_generated = not info.crate.root.is_source
-    path_prefix = _EXEC_ROOT_TEMPLATE if is_external or is_generated else ""
-    crate["is_workspace_member"] = not is_external
-    crate["root_module"] = path_prefix + info.crate.root.path
-    crate_root = path_prefix + info.crate.root.dirname
+    crate["is_workspace_member"] = True
+    crate["root_module"] = info.crate.root.path
+    crate_root = info.crate.root.dirname
 
     if info.build_info != None:
         out_dir_path = info.build_info.out_dir.path
diff --git a/tools/rust_analyzer/aquery.rs b/tools/rust_analyzer/aquery.rs
index 98f145be..fda67a04 100644
--- a/tools/rust_analyzer/aquery.rs
+++ b/tools/rust_analyzer/aquery.rs
@@ -100,6 +100,14 @@ pub fn get_crate_specs(
             serde_json::from_reader(f)
                 .with_context(|| format!("Failed to deserialize file: {}", file.display()))
         })
+        .map(|krate| {
+            let mut krate: CrateSpec = krate?;
+            let fullpath = workspace.join(&krate.root_module);
+            if let Ok(path) = std::fs::canonicalize(&fullpath) {
+                krate.root_module = path.into_os_string().into_string().unwrap();
+            }
+            Ok(krate)
+        })
         .collect::<anyhow::Result<Vec<CrateSpec>>>()?;
 
     consolidate_crate_specs(crate_specs)

from rules_rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.