pub fn handle_extract_function(req: &RawRequest, ctx: &AppContext) -> ResponseExpand description
Handle an extract_function request.
Params:
file(string, required) — target file pathname(string, required) — name for the new functionstart_line(u32, required) — first line of the range to extract (1-based)end_line(u32, required) — last line (exclusive, 1-based) of the range to extractdry_run(bool, optional) — if true, return diff without writing
Returns on success:
{ file, name, parameters, return_type, extracted_range, call_site_range, syntax_valid, backup_id }
Error codes:
unsupported_language— file is not TS/JS/TSX/Pythonthis_reference_in_range— range containsthis/self