mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Extract now properly validates line/column and those two params are required
This commit is contained in:
@@ -687,8 +687,7 @@ class Script(object):
|
|||||||
return refactoring.rename(self._inference_state, definitions, new_name)
|
return refactoring.rename(self._inference_state, definitions, new_name)
|
||||||
|
|
||||||
@_no_python2_support
|
@_no_python2_support
|
||||||
@validate_line_column
|
def extract_variable(self, line, column, **kwargs):
|
||||||
def extract_variable(self, line=None, column=None, **kwargs):
|
|
||||||
"""
|
"""
|
||||||
Moves an expression to a new statemenet.
|
Moves an expression to a new statemenet.
|
||||||
|
|
||||||
@@ -715,6 +714,7 @@ class Script(object):
|
|||||||
"""
|
"""
|
||||||
return self._extract_variable(line, column, **kwargs) # Python 2...
|
return self._extract_variable(line, column, **kwargs) # Python 2...
|
||||||
|
|
||||||
|
@validate_line_column
|
||||||
def _extract_variable(self, line, column, new_name, until_line=None, until_column=None):
|
def _extract_variable(self, line, column, new_name, until_line=None, until_column=None):
|
||||||
if until_line is None and until_column is None:
|
if until_line is None and until_column is None:
|
||||||
until_pos = None
|
until_pos = None
|
||||||
@@ -764,6 +764,7 @@ class Script(object):
|
|||||||
"""
|
"""
|
||||||
return self._extract_function(line, column, **kwargs) # Python 2...
|
return self._extract_function(line, column, **kwargs) # Python 2...
|
||||||
|
|
||||||
|
@validate_line_column
|
||||||
def _extract_function(self, line, column, new_name, until_line=None, until_column=None):
|
def _extract_function(self, line, column, new_name, until_line=None, until_column=None):
|
||||||
if until_line is None and until_column is None:
|
if until_line is None and until_column is None:
|
||||||
until_pos = None
|
until_pos = None
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ def x(v1):
|
|||||||
x
|
x
|
||||||
# -------------------------------------------------- in-class-range-1
|
# -------------------------------------------------- in-class-range-1
|
||||||
class X1:
|
class X1:
|
||||||
#? 11 text {'new_name': 'f', 'until_line': 4}
|
#? 9 text {'new_name': 'f', 'until_line': 4}
|
||||||
a = 3
|
a = 3
|
||||||
c = a + 2
|
c = a + 2
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
@@ -311,7 +311,7 @@ def f():
|
|||||||
|
|
||||||
|
|
||||||
class X1:
|
class X1:
|
||||||
#? 11 text {'new_name': 'f', 'until_line': 4}
|
#? 9 text {'new_name': 'f', 'until_line': 4}
|
||||||
c = f()
|
c = f()
|
||||||
# -------------------------------------------------- in-method-range-1
|
# -------------------------------------------------- in-method-range-1
|
||||||
glob1 = 1
|
glob1 = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user