fn extraction_target(
node: &SyntaxNode,
selection_range: TextRange,
) -> Option<FunctionBody>Expand description
Try to guess what user wants to extract
We have basically have two cases:
- We want whole node, like
loop {},2 + 2,{ let n = 1; }exprs. Then we can useast::Expr - We want a few statements for a block. E.g.
ⓘ
fn foo() -> i32 { let m = 1; $0 let n = 2; let k = 3; k + n $0 }