mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
support docs in app, platform and packages
This commit is contained in:
parent
d95da9dd5b
commit
f6799cae92
2 changed files with 41 additions and 4 deletions
|
@ -5400,11 +5400,48 @@ fn canonicalize_and_constrain<'a>(
|
|||
// Generate documentation information
|
||||
// TODO: store timing information?
|
||||
let module_docs = match header_type {
|
||||
HeaderType::App { .. } => None,
|
||||
HeaderType::Platform { .. } | HeaderType::Package { .. } => {
|
||||
// TODO: actually generate docs for platform and package modules.
|
||||
HeaderType::App {
|
||||
output_name: StrLiteral::PlainLine(str),
|
||||
..
|
||||
} => {
|
||||
let mut scope = module_output.scope.clone();
|
||||
scope.add_docs_imports();
|
||||
let docs = crate::docs::generate_module_docs(
|
||||
scope,
|
||||
module_id,
|
||||
module_ids,
|
||||
str.into(),
|
||||
&parsed_defs_for_docs,
|
||||
exposed_module_ids,
|
||||
module_output.exposed_symbols.clone(),
|
||||
parsed.header_comments,
|
||||
);
|
||||
Some(docs)
|
||||
}
|
||||
HeaderType::App { .. } => {
|
||||
//TODO:Eli This may not be needed after module params becuase app headers might have non string names
|
||||
None
|
||||
}
|
||||
HeaderType::Platform {
|
||||
config_shorthand, ..
|
||||
}
|
||||
| HeaderType::Package {
|
||||
config_shorthand, ..
|
||||
} => {
|
||||
let mut scope = module_output.scope.clone();
|
||||
scope.add_docs_imports();
|
||||
let docs = crate::docs::generate_module_docs(
|
||||
scope,
|
||||
module_id,
|
||||
module_ids,
|
||||
config_shorthand.into(),
|
||||
&parsed_defs_for_docs,
|
||||
exposed_module_ids,
|
||||
module_output.exposed_symbols.clone(),
|
||||
parsed.header_comments,
|
||||
);
|
||||
Some(docs)
|
||||
}
|
||||
HeaderType::Interface { name, .. }
|
||||
| HeaderType::Builtin { name, .. }
|
||||
| HeaderType::Hosted { name, .. } => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue