mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Add a method extract test
This commit is contained in:
@@ -298,7 +298,7 @@ def x(v1):
|
|||||||
#bar
|
#bar
|
||||||
return x
|
return x
|
||||||
x
|
x
|
||||||
# -------------------------------------------------- in-class-1
|
# -------------------------------------------------- in-class-range-1
|
||||||
class X1:
|
class X1:
|
||||||
#? 11 text {'new_name': 'f', 'until_line': 4}
|
#? 11 text {'new_name': 'f', 'until_line': 4}
|
||||||
a = 3
|
a = 3
|
||||||
@@ -313,3 +313,35 @@ def f():
|
|||||||
class X1:
|
class X1:
|
||||||
#? 11 text {'new_name': 'f', 'until_line': 4}
|
#? 11 text {'new_name': 'f', 'until_line': 4}
|
||||||
c = f()
|
c = f()
|
||||||
|
# -------------------------------------------------- in-method-range-1
|
||||||
|
glob1 = 1
|
||||||
|
class X:
|
||||||
|
# ha
|
||||||
|
def g(self): pass
|
||||||
|
|
||||||
|
# haha
|
||||||
|
def f(self, b, c):
|
||||||
|
#? 11 text {'new_name': 'ab', 'until_line': 12, 'until_column': 28}
|
||||||
|
#foo
|
||||||
|
local1 = 3
|
||||||
|
local2 = 4
|
||||||
|
x= self.g() or self.f(b) ^ glob1 & b is local1
|
||||||
|
# bar
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
glob1 = 1
|
||||||
|
class X:
|
||||||
|
# ha
|
||||||
|
def g(self): pass
|
||||||
|
|
||||||
|
# haha
|
||||||
|
def ab(self, b):
|
||||||
|
#foo
|
||||||
|
local1 = 3
|
||||||
|
local2 = 4
|
||||||
|
x= self.g() or self.f(b) ^ glob1 & b is local1
|
||||||
|
return x
|
||||||
|
|
||||||
|
def f(self, b, c):
|
||||||
|
#? 11 text {'new_name': 'ab', 'until_line': 12, 'until_column': 28}
|
||||||
|
x = self.ab(b)
|
||||||
|
# bar
|
||||||
|
|||||||
Reference in New Issue
Block a user