Workspaces and LSP Nonfunctional

Hello,

I am wondering if it's possible to use a Rust workspace with LSPs. I think I'd need to configure a rust-project.json, but whenever I've created one of these containing a simple sysroot_src and a single crate with a path to the root module, rust_analyzer gets unhappy and claims to fail to load the workspace.

Am I making this too hard? Is there a simpler way to create a Rust monorepo where I can cross-chain dependencies for various crates I may be developing? Right now I feel like I'm spending too much time fighting getting my editor working instead of just writing and learning Rust.

Okay so I have a temporary workaround, I think. There were a few issues:

  1. I had a typo in my rust-project.json, and my LSP logs showed this after some digging.
  2. Once #1 was resolved, I was only getting basic linting and no compiler feedback in my editor. If I abandon workspaces and instead use parallel crates in a repo + relative paths for the dependencies, Cargo still builds and my LSP in my editor gives me full usual feedback and recognizes the relative paths as well.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.