Stream: t-compiler/rust-analyzer

Topic: Wrong indexing in vscode


Chetan Khilosiya (May 07 2021 at 17:02, on Zulip):

In my environment, with latest vscode and RA. I have two window with RA and test project open. For test project also the indexing is performed for all 600+ crates.

Chetan Khilosiya (May 07 2021 at 17:03, on Zulip):

I know that RA uses those many crates but in test project there is only single crate dependency which may have not more than 50 transient dependencies.

Jonas Schievink [he/him] (May 07 2021 at 17:04, on Zulip):

is the test project in a cargo workspace that contains more crates?

Chetan Khilosiya (May 07 2021 at 17:04, on Zulip):

I have below questions:

  1. Who have responsibility of indexing? vscode or RA
  2. Why it reindex all crates from 1st RA project.
Chetan Khilosiya (May 07 2021 at 17:05, on Zulip):

no. the test project is single project to test RA debug.

Chetan Khilosiya (May 07 2021 at 17:06, on Zulip):

it does not have any code besides main function and single crate import statement.

Jonas Schievink [he/him] (May 07 2021 at 17:09, on Zulip):

RA indexes dependencies

Jonas Schievink [he/him] (May 07 2021 at 17:09, on Zulip):

can you push the code somewhere so we can try to reproduce?

Chetan Khilosiya (May 07 2021 at 17:10, on Zulip):
use s3::bucket;
fn main() {}
Chetan Khilosiya (May 07 2021 at 17:10, on Zulip):

this is the only code in main.rs

Chetan Khilosiya (May 07 2021 at 17:11, on Zulip):

cargo.toml has this single dependency rust-s3 = "0.26.4"

Chetan Khilosiya (May 07 2021 at 17:11, on Zulip):

this is happening with weekly release and latest master code also.

Chetan Khilosiya (May 07 2021 at 17:14, on Zulip):

I tested with single test project open also, then also it is indexing 600+ crates.

Jonas Schievink [he/him] (May 07 2021 at 17:16, on Zulip):

rust-s3 has ~350 transitive dependencies

Chetan Khilosiya (May 07 2021 at 17:16, on Zulip):

I recently updated rust toolchain to 1.52.0.

Chetan Khilosiya (May 07 2021 at 17:18, on Zulip):

On my machine RA indexes 764 crates.

Jonas Schievink [he/him] (May 07 2021 at 17:19, on Zulip):

yeah, I can reproduce that

Jonas Schievink [he/him] (May 07 2021 at 17:20, on Zulip):

but it's not a >10x increase, just ~2x or so

Jonas Schievink [he/him] (May 07 2021 at 17:21, on Zulip):

if you want to look into this, I think the next step would be to add some debug logging to print out what exactly all these crates are

Chetan Khilosiya (May 07 2021 at 17:22, on Zulip):

How did you get all transitive dependencies for rust-s3 crate?

Chetan Khilosiya (May 07 2021 at 17:23, on Zulip):

will need that to verify indexing crates list.

Jonas Schievink [he/him] (May 07 2021 at 17:24, on Zulip):

cargo tree

Chetan Khilosiya (May 07 2021 at 17:24, on Zulip):

BTW RA indexes 627 crates.

Last update: Jul 27 2021 at 22:00UTC