Skip to content

Excluding a crate from analysis? #8275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mexus opened this issue Mar 31, 2021 · 7 comments
Open

Excluding a crate from analysis? #8275

mexus opened this issue Mar 31, 2021 · 7 comments
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@mexus
Copy link

mexus commented Mar 31, 2021

Is there a way to exclude a single crate from analysis?

I've got a dependency in my project that takes too much time to analyze (about 5-10 minutes on ryzen 7 2700) due to a really large amount of proc-macro generated code in it, and since there's no persistent cache in rust-analyzer, every time I reopen the project I have to wait for quite some time for the whole thing to be processed. On the other hand, it's not like I can definitely live without types/completion from that crate..

Thanks!

@Kogia-sima
Copy link

+1 for this. It would be better if this feature alleviates heavy memory usage by rust-analyzer.

@flodiebold
Copy link
Member

Would #7449 suffice for your purposes?

@mexus
Copy link
Author

mexus commented Apr 7, 2021

Would #7449 suffice for your purposes?

In my case I've got an access to the crate that's causing troubles, so it's not impossible to add a #![rust_analyzer::skip] to its lib.rs.. but in general case I don't think the attribute could replace an "exclude a crate" capability.

@DJMcNab
Copy link
Contributor

DJMcNab commented Apr 7, 2021

I guess we would probably put this in the package.metadata.rust-analyzer section of Cargo.toml, added in #7891

Basically, we'd probably make it look something like the patch section, although it would probably require a lot of plumbing to make work nicely.

@mexus
Copy link
Author

mexus commented Apr 7, 2021

I guess we would probably put this in the package.metadata.rust-analyzer section of Cargo.toml, added in #7891

Basically, we'd probably make it look something like the patch section, although it would probably require a lot of plumbing to make work nicely.

Sounds great!

@Veykril Veykril added the S-actionable Someone could pick this issue up and work on it right now label Nov 27, 2021
@pwnorbitals
Copy link

https://app.bountysource.com/issues/97550097-excluding-a-crate-from-analysis

@azizur
Copy link

azizur commented Sep 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

7 participants