pub fn detect_return_value(
source: &str,
tree: &Tree,
start_byte: usize,
end_byte: usize,
enclosing_fn_end_byte: Option<usize>,
lang: LangId,
) -> ReturnKindExpand description
Detect what the extracted code range should return.
- If there’s an explicit
returnstatement in the range, use its expression. - If a variable declared in-range is referenced after the range (but within the enclosing function), that variable becomes the return value.
- Otherwise, void.