LSP-rust-analyzer icon indicating copy to clipboard operation
LSP-rust-analyzer copied to clipboard

Is it possible to cache the index results?

Open rwols opened this issue 3 years ago • 4 comments

It looks like rust-analyzer always starts to re-index the entire project anytime I start it. This can take quite a while. Is there a way to cache this index on disk so that it doesn't do that?

rwols avatar Jun 16 '21 19:06 rwols

Might need an issue in the rust-analyzer repo. Though I'm no rust expert.

rwols avatar Jun 16 '21 19:06 rwols

I'll just note that VSCode extension also doesn't seem to be doing any caching. Restarting VSCode reindexes the project.

rchl avatar Jun 16 '21 20:06 rchl

This is unfortunately by design. The indexing is done by cargo metadata and there is a local level of caching from cargo's end, typically with the dependencies so the next time it is faster. However rust-analyzer still needs to build its own data in memory so it knows the project structure and data. Any improvement there would need to be within the server.

Rapptz avatar Jun 19 '21 22:06 Rapptz

Already here I guess https://github.com/rust-analyzer/rust-analyzer/issues/4712

rwols avatar Jun 26 '21 18:06 rwols

Not something we would can handle on the package side anyway.

rchl avatar Sep 24 '24 15:09 rchl