When trying to auto-index https://sourcegraph.com/github.com/Picovoice/rhino, we run into a failure:
[ERROR rust_analyzer] Unexpected error: no projects
It seems like the underlying assumption -- that rust-analyzer will figure out the various crates etc. -- doesn't quite work. We should add some logic to spawn the correct rust-analyzer jobs based on the Cargo.toml files.
Noah attempted a fix earlier but I don't think that covers all the edge cases. Ideally, we would make sure that:
- If there are multiple unrelated crates (e.g. there is no workspace), they are all indexed.
- If there are multiple workspaces, they are all indexed.
- We shouldn't double-index crates that are part of a workspace (once for the workspace, and once inside the workspace).
- We shouldn't double-index crates that are local dependencies. (e.g. one crate depends on another via
path)
I think it would be reasonable to aim for 1, 2, and 3 for a first pass at fixing this problem. 4 may be a little tricky if one is using non-default features for the path imported crate.
For each criterion that should be satisfied, it would be good to add some tests.
This is probably as good a time as any to move the logic from a shell script to something more sensible (e.g. Go or Rust).
When trying to auto-index https://sourcegraph.com/github.com/Picovoice/rhino, we run into a failure:
It seems like the underlying assumption -- that
rust-analyzerwill figure out the various crates etc. -- doesn't quite work. We should add some logic to spawn the correct rust-analyzer jobs based on theCargo.tomlfiles.Noah attempted a fix earlier but I don't think that covers all the edge cases. Ideally, we would make sure that:
path)I think it would be reasonable to aim for 1, 2, and 3 for a first pass at fixing this problem. 4 may be a little tricky if one is using non-default features for the path imported crate.
For each criterion that should be satisfied, it would be good to add some tests.
This is probably as good a time as any to move the logic from a shell script to something more sensible (e.g. Go or Rust).