Vscode-rust: support for opening a parent directory of the rust project

Created on 19 Feb 2019  路  7Comments  路  Source: rust-lang/vscode-rust

I have a project laid out as a monorepo, something like:

my-project/
  api/
  web/
  rust-project/

Now rls-vscode works great if I open up vscode at my-project/rust-project/ but it doesn't work at all if I open up the root folder my-project/ as I prefer to do:

could not find 'Cargo.toml' in 'my-project/' or any parent directory

It would be nice to support project lookup relative to the file actually being edited as opposed to just assuming that the whole folder is a rust project. Because monorepos, blah blah blah.

bug

Most helpful comment

A pull request solving this issue is open here #638 !

All 7 comments

Having the same issue, kind of annoying :(

yea just ran into this as well, can work around it but this particular issue does make working with mono-repo style projects less than ideal.

A pull request solving this issue is open here #638 !

FWIW this works out of the box with rust-analyzer.

@samuela I am not sure it does, I am currently running on Windows with Rust-client Engine set to rust-analyzer in my user settings and it only works for me when my root directory is the rust project folder

Further testing it looks to only go one parent folder deep. My folder structure looks more like this:

my-project/
    backend/
    webpack-frontend/
        wasm-crate/

when in my-project wasm-crate does not get completion. Although I guess quick fix would be to rearrange like this:

my-project/
    backend/
    wasm-crate/
    webpack-frontend/

then just use a relative path from webpack-frontend to wasm-crate.

Sorry I am just doing stream of conscious, if someone else comes across my same case could be useful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iBeizsley picture iBeizsley  路  3Comments

Tape-Worm picture Tape-Worm  路  4Comments

alexreg picture alexreg  路  3Comments

not-fl3 picture not-fl3  路  3Comments

harrier-lcc picture harrier-lcc  路  4Comments