Skip to main content

find_method

Function find_method 

Source
pub fn find_method<'a>(
    tree: &'a Tree,
    source: &str,
    class_name: &str,
    method_name: &str,
) -> Option<Node<'a>>
Expand description

The method_declaration named method_name inside the class_ declaration named class_name - queries broadly for every method_declaration by kind, then filters by name and climbs to its enclosing class via find_ancestor (the same “query broadly, check/ climb from each match” shape requests.rs already established for rules(), rather than trying to correlate a class-name capture and a method-name capture from one query - this crate’s query helpers only return nodes for one named capture at a time).