MCPcopy Create free account
hub / github.com/amber-lang/amber / document

Method document

src/modules/function/declaration.rs:507–521  ·  view source on GitHub ↗
(&self, meta: &ParserMetadata)

Source from the content-addressed store, hash-verified

505}
506impl DocumentationModule for FunctionDeclaration {
507 fn document(&self, meta: &ParserMetadata) -> String {
508 let mut result = vec![];
509 result.push(format!("## `{}`\n", self.name));
510 result.push("```ab".to_string());
511 result.push(self.doc_signature.to_owned().unwrap());
512 result.push("```\n".to_string());
513 if let Some(comment) = &self.comment {
514 let comment_text = comment.document(meta);
515 // Check if comment has Usage section with code block and insert import statement
516 let comment_text = self.insert_usage_import_statement(meta, comment_text);
517 result.push(comment_text);
518 }
519 result.push("".to_string());
520 result.join("\n")
521 }
522}
523
524impl FunctionDeclaration {

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.45

Tested by

no test coverage detected