Stream: t-compiler/wg-rls-2.0

Topic: #503 finding public module path


Zac Pullar-Strecker (Jun 05 2020 at 02:54, on Zulip):

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?

Zac Pullar-Strecker (Jun 05 2020 at 03:20, on Zulip):

Just found #3947, seems like it might be somewhat related?

std::Veetaha (Jun 05 2020 at 17:09, on Zulip):

@Kirill Bulatov worked on ImportsLocator, maybe he can share some knowledge on this topic?

Kirill Bulatov (Jun 06 2020 at 11:36, on Zulip):

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.

Zac Pullar-Strecker (Jun 06 2020 at 22:53, on Zulip):

Thanks, I'll take a look.

Last update: Sep 27 2020 at 14:15UTC