Merge branch 'master' of git.labs.intellij.net:idea/ultimate

This commit is contained in:
Dmitry Cheryasov
2010-09-04 16:05:14 +03:00
3 changed files with 20 additions and 0 deletions
@@ -385,6 +385,9 @@ public class PyBlock implements ASTBlock {
while (lastChild != null) {
IElementType last_type = lastChild.getElementType();
if ( last_type == PyElementTypes.STATEMENT_LIST && hasLineBreakBefore(lastChild)) {
if (dedentAfterLastStatement((PyStatementList)lastChild.getPsi())) {
break;
}
statementListsBelow++;
}
else if (statementListsBelow > 0 && lastChild.getPsi() instanceof PsiErrorElement) {
@@ -96,6 +96,10 @@ public class PyEditingTest extends PyLightFixtureTestCase {
myFixture.checkResultByFile("/editing/uncommentWithSpace.after.py", true);
}
public void testEnterInLineComment() { // PY-1739
assertEquals("# foo\n# bar", doTestTyping("# foo bar", 5, '\n'));
}
private String doTestTyping(final String text, final int offset, final char character) {
final PsiFile file = ApplicationManager.getApplication().runWriteAction(new Computable<PsiFile>() {
public PsiFile compute() {
@@ -167,6 +167,19 @@ public class PyIndentTest extends PyLightFixtureTestCase {
" <caret>");
}
public void testUnindentAfterReturnNotLast() { // PY-289
doTest("def foo():\n" +
" if True:\n" +
" return<caret>\n" +
"def bar(): pass",
"def foo():\n" +
" if True:\n" +
" return\n" +
" <caret>\n" +
"def bar(): pass"
);
}
/*
TODO: formatter core problem?
public void testAlignListBeforeEquals() throws Exception {