Skip to content

Parts of RA re-execute itself, making it unsuitable for use as a library #10516

@aidanhs

Description

@aidanhs

Specifically https://github.com/rust-analyzer/rust-analyzer/blob/ed4b312fa777ebb39ba1348fe3df574c441a485e/crates/rust-analyzer/src/cli/load_cargo.rs#L44-L63

I was surprised, because the comment says "this function is used by external tools that use rust-analyzer as a library" - but it then promptly re-executes RA.

I was able to work around via environment variables in my binary code, but I couldn't find this gotcha documented anywhere (in particular, in ARCHITECTURE.md).

Metadata

Metadata

Assignees

Labels

C-ArchitectureBig architectural things which we need to figure up-front (or suggestions for rewrites :0) )C-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions