I'm looking at the https://github.com/rust-analyzer/rust-analyzer/issues/1064 issue
So far I've got something like this:
input string on the top, this is the mod path).
But then I look at what intellij-rust does and see a crate "name" there:
This way it looks way better, imo.
Yet, we lack the proper way to get that name, since the only crate-related names we operate is a name of a crate that is declared as a dependency.
Is there a way to get the name of a crate that is used when the crate is declared?
Not really at the moment
It would be fine to add this info to
ra_ide crate, but not to the
hir. We used to have something similar for debugging infra, but we removed it when we split the hir
If you share a pointer to the removal PR, it will help.
I thought you were talking about this debugging infra, but it wasn't removed
What if we add the crate name info to
ra_db level instead, making the
CrateData to contain the
declaration_name (or whatever better name used) with the property required?
add_crate_root method can accept one more parameter.
The main issue would be to get some name for the project.json case (https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-project.2Ejson/near/188152985), so we can keep this property
Optional for a while or use some dummy values for those crates instead.
I now think that maybe we should store an optional display name in
CrateGraph? It would be useful for profiling as well at least and,
practically, it should be hard to misuse.
CrateData is also in the
CrateGraph, so we're talking almost about the same.
I'm a bit reluctant to make it optional, since every crate has its own declaration name, doesn't it?
Actually, never mind, it should be optional, I've confused different kinds of crate names.