mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-29 09:23:46 +00:00
cleanup getting docs for symbol
This commit is contained in:
parent
321baf86d1
commit
ee264981b6
2 changed files with 12 additions and 19 deletions
|
@ -17,6 +17,14 @@ pub struct ModuleDocumentation {
|
|||
pub scope: Scope,
|
||||
pub exposed_symbols: VecSet<Symbol>,
|
||||
}
|
||||
impl ModuleDocumentation {
|
||||
pub fn get_doc_for_symbol(&self, symb: &Symbol) -> Option<String> {
|
||||
self.entries.iter().find_map(|doc| match doc {
|
||||
DocEntry::DocDef(DocDef { symbol, docs, .. }) if symbol == symb => docs.clone(),
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum DocEntry {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue