Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

How to seperate crate name from qualname? #136

Open
jendrikw opened this issue May 12, 2018 · 3 comments
Open

How to seperate crate name from qualname? #136

jendrikw opened this issue May 12, 2018 · 3 comments
Labels

Comments

@jendrikw
Copy link

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?

@nrc nrc added the bug label May 12, 2018
@nrc
Copy link
Member

nrc commented May 12, 2018

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 :-(

@jendrikw
Copy link
Author

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

@nrc
Copy link
Member

nrc commented Jun 3, 2018

I think the value field has it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants