mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
smart indent on paste for Python (PY-208)
This commit is contained in:
@@ -175,6 +175,8 @@
|
||||
<moduleService serviceInterface="com.jetbrains.python.psi.resolve.PythonPathCache"
|
||||
serviceImplementation="com.jetbrains.python.psi.resolve.PythonPathCache"/>
|
||||
|
||||
<copyPastePostProcessor implementation="com.jetbrains.python.codeInsight.CopyPasteIndentProcessor"/>
|
||||
|
||||
<!-- Django -->
|
||||
<codeInsight.lineMarkerProvider language="Python" implementationClass="com.jetbrains.django.annotator.ViewMethodLineMarkerProvider"/>
|
||||
<configurationType implementation="com.jetbrains.django.run.DjangoServerRunConfigurationType"/>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
def bar():
|
||||
x = 1
|
||||
y = 2
|
||||
@@ -0,0 +1,2 @@
|
||||
def bar():
|
||||
<caret>
|
||||
@@ -0,0 +1,4 @@
|
||||
class C:
|
||||
def foo(self):
|
||||
<selection> x = 1
|
||||
y = 2</selection>
|
||||
@@ -0,0 +1,3 @@
|
||||
def bar():
|
||||
x = 1
|
||||
y = 2
|
||||
@@ -0,0 +1,2 @@
|
||||
def bar():
|
||||
<caret>
|
||||
@@ -0,0 +1,4 @@
|
||||
class C:
|
||||
def foo(self):
|
||||
<selection>x = 1
|
||||
y = 2</selection>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.jetbrains.python;
|
||||
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.jetbrains.python.fixtures.PyLightFixtureTestCase;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PyCopyPasteTest extends PyLightFixtureTestCase {
|
||||
public void testIndent1() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIndent2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
String name = getTestName(false);
|
||||
myFixture.configureByFile("copyPaste/" + name + ".src.py");
|
||||
myFixture.performEditorAction(IdeActions.ACTION_EDITOR_COPY);
|
||||
myFixture.configureByFile("copyPaste/"+ name + ".dst.py");
|
||||
myFixture.performEditorAction(IdeActions.ACTION_EDITOR_PASTE);
|
||||
myFixture.checkResultByFile("copyPaste/" + name + ".after.py");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user