Ruin0x11 / oxidoc

A command line interface to Rust documentation
102 stars 15 forks source link

Handle 'use' with globbed paths #2

Open Ruin0x11 opened 7 years ago

Ruin0x11 commented 7 years ago

Having a use with a globbed path should allow including documentation generated by an impl referencing a module in the globbed path.

// main.rs in crate 'test'

pub mod a {
    pub struct MyStruct;
}

pub mod b {
    use a::*;

    impl MyStruct {
        /// Documentation for test_a.
        pub fn test_a(&self) {
            println!("Hello, world!");
        }
    }
}

fn main() {
    let one = a::MyStruct;
    one.test_a();
}

In this example, documentation for test::a::MyStruct::test_a() should be indexed.

rustdoc does this by using High IR information, but since no compilation is done we don't have that.