From 1f82efa86daca70430686357c40d9e3826a94bd7 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 25 Feb 2020 23:27:21 +0100 Subject: [PATCH] Fix a newline issue for refactoring functions --- jedi/api/refactoring/extract.py | 2 +- test/refactor/extract_function.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/jedi/api/refactoring/extract.py b/jedi/api/refactoring/extract.py index 19ddfcd6..1b826a32 100644 --- a/jedi/api/refactoring/extract.py +++ b/jedi/api/refactoring/extract.py @@ -266,7 +266,7 @@ def extract_function(inference_state, path, module_context, name, pos, until_pos if is_expression: replacement = function_call else: - replacement = _get_indentation(nodes[0]) + output_var_str + ' = ' + function_call + replacement = _get_indentation(nodes[0]) + output_var_str + ' = ' + function_call + '\n' replacement_dct = _replace(nodes, replacement, function_code, pos, insert_before_leaf, remaining_prefix) diff --git a/test/refactor/extract_function.py b/test/refactor/extract_function.py index ab589165..5f39bb87 100644 --- a/test/refactor/extract_function.py +++ b/test/refactor/extract_function.py @@ -159,7 +159,6 @@ def x(z): v1 = 3 v2 = 2 x = test(v1 + v2 * v3) - # ++++++++++++++++++++++++++++++++++++++++++++++++++ #? 0 text {'new_name': 'a', 'until_line': 4} def a(test, v3):