rust-dev-tools / cargo-src

Semantic code navigation for Rust
Apache License 2.0
417 stars 31 forks source link

Allow collapsing definitions #245

Open eira-fransham opened 6 years ago

eira-fransham commented 6 years ago

Probably this would just be something like turning the line object into a

enum SourceElement {
    Line { .. },
    Scope {
        /// The text shown when this scope is collapsed
        /// For this enum, it would be `enum SourceElement`
        summary: String,
        elements: Vec<SourceElement>,
    }
}

and handling this in the JS. I don't know how we'd actually generate that though.