Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

How to seperate crate name from qualname? #1371

Open
Xanewok opened this issue Feb 25, 2019 · 3 comments
Open

How to seperate crate name from qualname? #1371

Xanewok opened this issue Feb 25, 2019 · 3 comments

Comments

@Xanewok
Copy link
Member

Xanewok commented Feb 25, 2019

Originally created by @jendrikw (rust-dev-tools/rls-analysis#136):

In src/lowering.rs#L275 crate_name and qualname are concatenated. This creates very interesting results for the qualname, for example:

  • std<f64>::cbrt
  • libc::unix::::readdir (not sure if this one belong here)
  • core<char>::is_lowercase
  • alloc<[T]>::into_vec

Why is this done and how are you supposed to get the crate name form this?

@Xanewok
Copy link
Member Author

Xanewok commented Feb 25, 2019

Originally replied by @nrc (rust-dev-tools/rls-analysis#136 (comment)):

qualname can be pretty buggy, I don't think the RLS uses it for anything. We should probably track all the bugs. And with the changes to imports happening in the 2018 edition, we will probably need to change some things anyway.

The first token in the qualname should be the crate name (up to ::) and where it isn't that is a bug, but as you've noticed there are a lot of bugs :-(

@Xanewok
Copy link
Member Author

Xanewok commented Feb 25, 2019

Originally replied by @jendrikw (rust-dev-tools/rls-analysis#136 (comment)):

Is there another way besides qualname to get the type of a function?

@Xanewok
Copy link
Member Author

Xanewok commented Feb 25, 2019

Originally replied by @nrc (rust-dev-tools/rls-analysis#136 (comment)):

I think the value field has it

@Xanewok Xanewok added the bug label Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant