Skip to main content

find_enclosing_function

Function find_enclosing_function 

Source
fn find_enclosing_function(line: &str) -> Option<&str>
Expand description

Try to find the enclosing function name for the cursor position.

Walks backward from pos through line, tracking parenthesis depth. When we find an unmatched (, the identifier before it is the function name. Returns None if the cursor is not inside a function call.