rls icon indicating copy to clipboard operation
rls copied to clipboard

RLS creates target directory for crates despite being in a workspace

Open zaszi opened this issue 5 years ago • 2 comments

I have a project as follows, using Cargo workspaces:

my_project
├── crate1/
│   ├── Cargo.toml
│   ├── src
│   └── target
│       └── rls
├── crate2/
│   ├── Cargo.toml
│   ├── src
│   └── target
│       └── rls
├── Cargo.lock
├── Cargo.toml
└── target
    ├── CACHEDIR.TAG
    ├── debug
    │   ├── build
    │   ├── deps
    │   ├── examples
    │   └── incremental
    └── release
        ├── build
        ├── crate1
        ├── crate1.d
        ├── crate2
        ├── crate2.d
        ├── deps
        ├── examples
        ├── incremental

Note how there exists a target directory for both crate1 and crate2 containing an rls subdirectory. These are created as soon as I open the project in my IDE which triggers RLS.

This is a bit counter-intuitive as the documentation for Cargo Workspaces mentions that crates in a workspace should not have their own target directory. Additionally, this inevitably results in mistakes when it comes to the default Cargo-generated.gitignore.

I wasn't able to find any clear-cut information on this. Is this a bug or does this have a solution or workaround?

zaszi avatar Aug 10 '20 12:08 zaszi

Is there any update on this issue?

acidghost avatar Dec 29 '20 09:12 acidghost

@acidghost I never found a solution or workaround. I ended up switching to rust-analyzer instead, which does not have this issue and seems to be more actively developed than RLS.

zaszi avatar Dec 29 '20 09:12 zaszi