meet brand new python move statement

work over PSI instead of document lines
This commit is contained in:
Ekaterina Tuzova
2013-08-24 17:35:25 +04:00
parent 9e53670fff
commit 25504900e1
34 changed files with 549 additions and 531 deletions
@@ -1,3 +1,4 @@
def f():
#comment
if True:
@@ -2,4 +2,4 @@ if True:
a = 1
else:
a = 2
#comment <caret>
#comment <caret>
+1 -1
View File
@@ -3,4 +3,4 @@ def f():
a = 1
else:
a = 2
#comment
#comment
@@ -7,4 +7,4 @@ class A:
pass
<selection>def<caret> bar(self):
pass</selection>
pass</selection>
@@ -1,7 +1,7 @@
class A:
<selection>def<caret> bar(self):
pass</selection>
pass</selection>
def foo(self):
pass
@@ -2,4 +2,4 @@ def a():
zoo(1)
def b():
pass
pass
@@ -1,5 +1,5 @@
def a():
def b():
pass
zoo(1)
+1 -1
View File
@@ -4,4 +4,4 @@ class A:
def c(self):
doSomething3()
def b(self):
doSomething2()
doSomething2()
@@ -1,6 +1,6 @@
def a():
if True:
a = 1
else:
c = 1
else:
b = 2
+2 -1
View File
@@ -1,3 +1,4 @@
if value is not None:
if not False or value <= 2:
print "here"
pass
print "here"
+6
View File
@@ -0,0 +1,6 @@
def f():
if True:
a = 1
else:
a = 2
#comment <caret>
+6
View File
@@ -0,0 +1,6 @@
def f():
if True:
a = 1
else:
a = 2
#comment <caret>
@@ -0,0 +1,6 @@
def f():
if True:
a = 1
else:
a = 2
#comment <caret>
@@ -0,0 +1,7 @@
def f():
if True:
a = 1
else:
a = 2
#comment <caret>
@@ -0,0 +1,6 @@
def f():
if True:
a = 1
else:
a = 2
#comment <caret>
@@ -0,0 +1,6 @@
def f():
if True:
a = 1
else:
#comment <caret>
a = 2
+3
View File
@@ -0,0 +1,3 @@
for item in range(1,
3):
b = 2<caret>
@@ -0,0 +1,4 @@
for item in range(1,
3):
pass
b = 2<caret>
@@ -0,0 +1,4 @@
b = 2<caret>
for item in range(1,
3):
pass
@@ -4,4 +4,5 @@ def test(a, b=1):
else:
for n in range(10):
print(b)
pass
print(b)
@@ -2,5 +2,6 @@ if condition:
pass
elif other_condition:
if another_one:
if T<caret>rue: a = 1 # <- move statement up here
else: b = 2
pass
if True: a = 1 # <- move statement up here
else: b = 2
@@ -1,4 +1,4 @@
c = 1
if True:
a = 1
b = 2
b = 2
@@ -1,4 +1,5 @@
test2()
def foo():
test()
pass
test()
test1()
@@ -1,4 +1,5 @@
test2()
test()
def foo():
test()
pass
test1()
@@ -1,3 +1,4 @@
if True:
a = 1 # <- move statement down here
else:
+6
View File
@@ -0,0 +1,6 @@
if True:
a = 1
else:
#comment
a =<caret> 3
a = 2
@@ -0,0 +1,6 @@
if True:
a = 1
else:
#comment
a = 2
a =<caret> 3
@@ -0,0 +1,6 @@
if True:
a = 1
else:
a =<caret> 3
#comment
a = 2
@@ -4,4 +4,5 @@ try:
except:
print(zoo(0).foo(2))
except:
zoo<caret>(3)
pass
zoo(3)