extract_functions_from_ast

Function extract_functions_from_ast 

Source
pub fn extract_functions_from_ast(
    syntax: &SyntaxNode,
    remove_doc_comments: bool,
) -> Vec<FunctionInfo>
Expand description

Extracts functions from a syntax node, returning a list of FunctionInfo.

We find all Fn items in the file. For each:

  • Extract name (skip if none).
  • Check attributes for #[test].
  • Check visibility for pub.
  • Extract signature line from the syntax.
  • Extract body if present.