racer-rust / racer

Rust Code Completion utility
MIT License
3.36k stars 279 forks source link

Does not complete for inner type on lock guards. #455

Open johalun opened 8 years ago

johalun commented 8 years ago

Hi! Thank you for your effort on this wonderful project. It's a lifesaver for me :)

I would love it if it was possible to add completion for T when you have things like RwLockReadGuard, RwLockWriteGuard, MutexGuard, etc.

Thank you.

Jonesey13 commented 8 years ago

I did this for Box<T> earlier (see Issue #438) using the rather naive approach of seeing if the type begins with the string "Box" and then searching for completions on the inner type. This method could easily be extended to the types you mentioned but involves a bit of repetition and is not terribly robust.

What would be ideal is to find implementations of Deref<Target=T> for a given type and then look for methods on the type T.

Update: This issue should hopefully be fixed now :)