mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rewritten move statement for python (see PY-3284, PY-1834, PY-3283)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
def a():
|
||||
print 'a'
|
||||
|
||||
@task
|
||||
<caret>def b():
|
||||
print 'b'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@task
|
||||
<caret>def b():
|
||||
def b():
|
||||
print 'b'
|
||||
|
||||
def a():
|
||||
print 'a'
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
if condition1:
|
||||
pass
|
||||
|
||||
if condi<caret>tion:
|
||||
test1()
|
||||
else:
|
||||
test2()
|
||||
@@ -0,0 +1,7 @@
|
||||
if condition1:
|
||||
pass
|
||||
|
||||
if condition:
|
||||
test1()
|
||||
else:
|
||||
test2()
|
||||
@@ -0,0 +1,5 @@
|
||||
if condition1:
|
||||
if condition:
|
||||
test1()
|
||||
else:
|
||||
test2()
|
||||
@@ -1,9 +1,7 @@
|
||||
class A:
|
||||
def a(self):
|
||||
doSomething()
|
||||
|
||||
doSomething1()
|
||||
def b<caret>(self):
|
||||
doSomething()
|
||||
|
||||
doSomething2()
|
||||
def c(self):
|
||||
doSomething()
|
||||
doSomething3()
|
||||
@@ -1,9 +1,7 @@
|
||||
class A:
|
||||
def a(self):
|
||||
doSomething()
|
||||
|
||||
doSomething1()
|
||||
def c(self):
|
||||
doSomething()
|
||||
|
||||
doSomething3()
|
||||
def b(self):
|
||||
doSomething()
|
||||
doSomething2()
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
class A:
|
||||
def b(self):
|
||||
doSomething()
|
||||
|
||||
doSomething2()
|
||||
def a(self):
|
||||
doSomething()
|
||||
|
||||
doSomething1()
|
||||
def c(self):
|
||||
doSomething()
|
||||
doSomething3()
|
||||
@@ -5,9 +5,9 @@ class A:
|
||||
if c:
|
||||
if d:
|
||||
self.bar()
|
||||
c = 3
|
||||
if c:
|
||||
a = 2
|
||||
c = 3
|
||||
|
||||
def bar(self):
|
||||
pass
|
||||
@@ -4,8 +4,8 @@ class A:
|
||||
if b:
|
||||
if c:
|
||||
if d:
|
||||
c = 3
|
||||
self.bar()
|
||||
c = 3
|
||||
if c:
|
||||
a = 2
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
if value is not None:
|
||||
if not False or value <= 2:
|
||||
print "h<caret>ere"
|
||||
@@ -0,0 +1,3 @@
|
||||
if value is not None:
|
||||
if not False or value <= 2:
|
||||
print "here"
|
||||
@@ -0,0 +1,4 @@
|
||||
if value is not None:
|
||||
print "here"
|
||||
if not False or value <= 2:
|
||||
pass
|
||||
@@ -0,0 +1,3 @@
|
||||
print "first"
|
||||
|
||||
print "second"<caret>
|
||||
@@ -0,0 +1,3 @@
|
||||
print "first"
|
||||
|
||||
print "second"
|
||||
@@ -0,0 +1,3 @@
|
||||
print "first"
|
||||
print "second"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
if condition:
|
||||
if condition2:
|
||||
print "test"
|
||||
prin<caret>t "test1"
|
||||
print "test2"
|
||||
@@ -0,0 +1,5 @@
|
||||
if condition:
|
||||
if condition2:
|
||||
print "test"
|
||||
print "test1"
|
||||
print "test2"
|
||||
@@ -0,0 +1,5 @@
|
||||
if condition:
|
||||
if condition2:
|
||||
print "test1"
|
||||
print "test"
|
||||
print "test2"
|
||||
@@ -0,0 +1,7 @@
|
||||
while condition1:
|
||||
pass
|
||||
|
||||
if condition:
|
||||
test<caret>1()
|
||||
else:
|
||||
test2()
|
||||
@@ -0,0 +1,8 @@
|
||||
while condition1:
|
||||
pass
|
||||
|
||||
if condition:
|
||||
pass
|
||||
else:
|
||||
test1()
|
||||
test2()
|
||||
@@ -0,0 +1,8 @@
|
||||
while condition1:
|
||||
pass
|
||||
|
||||
test1()
|
||||
if condition:
|
||||
pass
|
||||
else:
|
||||
test2()
|
||||
@@ -1,12 +1,12 @@
|
||||
class A:
|
||||
def f(self, a, b):
|
||||
while a:
|
||||
a = a / 2
|
||||
if a:
|
||||
b = 1
|
||||
elif b:
|
||||
a = 1
|
||||
else:
|
||||
print "a"
|
||||
a = a / 2
|
||||
for i in range(1, 10):
|
||||
print i
|
||||
@@ -0,0 +1,7 @@
|
||||
def test(a, b=1):
|
||||
if a:
|
||||
print(a)
|
||||
else:
|
||||
for n in range(10):
|
||||
|
||||
<caret> print(b)
|
||||
@@ -0,0 +1,7 @@
|
||||
def test(a, b=1):
|
||||
if a:
|
||||
print(a)
|
||||
else:
|
||||
for n in range(10):
|
||||
|
||||
print(b)
|
||||
@@ -0,0 +1,7 @@
|
||||
def test(a, b=1):
|
||||
if a:
|
||||
print(a)
|
||||
else:
|
||||
for n in range(10):
|
||||
print(b)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class B(Exception):
|
||||
pas<caret>s #<---here
|
||||
class C(B):
|
||||
pass
|
||||
@@ -0,0 +1,4 @@
|
||||
class B(Exception):
|
||||
pass #<---here
|
||||
class C(B):
|
||||
pass
|
||||
@@ -0,0 +1,4 @@
|
||||
class B(Exception):
|
||||
pass #<---here
|
||||
class C(B):
|
||||
pass
|
||||
@@ -0,0 +1,4 @@
|
||||
test2()
|
||||
def foo():
|
||||
t<caret>est()
|
||||
test1()
|
||||
@@ -0,0 +1,4 @@
|
||||
test2()
|
||||
def foo():
|
||||
test()
|
||||
test1()
|
||||
@@ -0,0 +1,4 @@
|
||||
test2()
|
||||
def foo():
|
||||
test()
|
||||
test1()
|
||||
@@ -3,6 +3,6 @@ def foo():
|
||||
|
||||
if a:
|
||||
pass
|
||||
|
||||
a = 4
|
||||
a = 3
|
||||
|
||||
a = 4
|
||||
@@ -2,6 +2,6 @@ class A:
|
||||
def foo(self):
|
||||
if a: pass
|
||||
else: pass
|
||||
if a: pass
|
||||
else: pass
|
||||
a <caret>= 0
|
||||
if a:
|
||||
a = 0
|
||||
else: pass
|
||||
@@ -1,7 +1,7 @@
|
||||
class A:
|
||||
def foo(self):
|
||||
a <caret>= 0
|
||||
if a: pass
|
||||
else: pass
|
||||
else:
|
||||
a = 0
|
||||
if a: pass
|
||||
else: pass
|
||||
@@ -2,8 +2,8 @@ if a:
|
||||
a = 1
|
||||
|
||||
|
||||
c = 3
|
||||
|
||||
|
||||
|
||||
b = 2
|
||||
|
||||
|
||||
c = 3
|
||||
@@ -1,9 +1,9 @@
|
||||
if a:
|
||||
a = 1
|
||||
|
||||
b = 2
|
||||
|
||||
|
||||
a = 1
|
||||
|
||||
|
||||
|
||||
c = 3
|
||||
Reference in New Issue
Block a user