Hey I'm working on #503 and I'm trying to figure out how to find the public path to a symbol from the root module. Would doing a breadth/depth search from the root module via the
crate_def_map be the best solution?
Just found #3947, seems like it might be somewhat related?
@Kirill Bulatov worked on ImportsLocator, maybe he can share some knowledge on this topic?
If you just have a string representation of the symbol, you might check the
ImportsLocator internals to see how to use the fuzzy text search we have.
Yet this is not very presise (does not consider macros expansions at all, for instance) and might misbehave in some cases like https://github.com/rust-analyzer/rust-analyzer/issues/4763
I think the more proper approach would be to use something similar to the https://github.com/rust-analyzer/rust-analyzer/pull/4748 with additional improvements.
Thanks, I'll take a look.