mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Handle params better for extract variable
This commit is contained in:
@@ -16,6 +16,13 @@ def test():
|
||||
#? 25 text {'new_name': 'a'}
|
||||
a = 30 + b
|
||||
return test(100, (a, c) + 1)
|
||||
# -------------------------------------------------- simple-3
|
||||
#? 13 text {'new_name': 'zzx.x'}
|
||||
test(100, {1 |1: 2 + 3})
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#? 13 text {'new_name': 'zzx.x'}
|
||||
zzx.x = 1 |1
|
||||
test(100, {zzx.x: 2 + 3})
|
||||
# -------------------------------------------------- multiline-1
|
||||
def test():
|
||||
#? 30 text {'new_name': 'x'}
|
||||
@@ -38,3 +45,24 @@ def test():
|
||||
x = 30 + b
|
||||
return test(1, (x, c)
|
||||
+ 1)
|
||||
# -------------------------------------------------- for-param-error-1
|
||||
#? 10 error {'new_name': 'x'}
|
||||
def test(p1):
|
||||
return
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
Cannot extract a definition of a name
|
||||
# -------------------------------------------------- for-param-error-2
|
||||
#? 12 error {'new_name': 'x'}
|
||||
def test(p1= 3):
|
||||
return
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
Cannot extract a param
|
||||
# -------------------------------------------------- for-param-1
|
||||
#? 12 text {'new_name': 'x'}
|
||||
def test(p1=20):
|
||||
return
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#? 12 text {'new_name': 'x'}
|
||||
x = 20
|
||||
def test(p1=x):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user