mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix a newline issue for refactoring functions
This commit is contained in:
@@ -266,7 +266,7 @@ def extract_function(inference_state, path, module_context, name, pos, until_pos
|
|||||||
if is_expression:
|
if is_expression:
|
||||||
replacement = function_call
|
replacement = function_call
|
||||||
else:
|
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,
|
replacement_dct = _replace(nodes, replacement, function_code, pos,
|
||||||
insert_before_leaf, remaining_prefix)
|
insert_before_leaf, remaining_prefix)
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ def x(z):
|
|||||||
v1 = 3
|
v1 = 3
|
||||||
v2 = 2
|
v2 = 2
|
||||||
x = test(v1 + v2 * v3)
|
x = test(v1 + v2 * v3)
|
||||||
|
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
#? 0 text {'new_name': 'a', 'until_line': 4}
|
#? 0 text {'new_name': 'a', 'until_line': 4}
|
||||||
def a(test, v3):
|
def a(test, v3):
|
||||||
|
|||||||
Reference in New Issue
Block a user