mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Make right par indent=none in import statement (PY-9075).
This commit is contained in:
@@ -213,13 +213,17 @@ public class PyBlock implements ASTBlock {
|
||||
}
|
||||
}
|
||||
else if (parentType == PyElementTypes.FROM_IMPORT_STATEMENT) {
|
||||
if ((childType == PyElementTypes.IMPORT_ELEMENT || childType == PyTokenTypes.RPAR) &&
|
||||
_node.findChildByType(PyTokenTypes.LPAR) != null) {
|
||||
if (myContext.getPySettings().ALIGN_MULTILINE_IMPORTS) {
|
||||
childAlignment = getAlignmentForChildren();
|
||||
if (_node.findChildByType(PyTokenTypes.LPAR) != null) {
|
||||
if (childType == PyElementTypes.IMPORT_ELEMENT) {
|
||||
if (myContext.getPySettings().ALIGN_MULTILINE_IMPORTS) {
|
||||
childAlignment = getAlignmentForChildren();
|
||||
}
|
||||
else {
|
||||
childIndent = Indent.getNormalIndent();
|
||||
}
|
||||
}
|
||||
else {
|
||||
childIndent = Indent.getNormalIndent();
|
||||
if (childType == PyTokenTypes.RPAR) {
|
||||
childIndent = Indent.getNoneIndent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
from some.module import (
|
||||
thing
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
from some.module import (
|
||||
thing
|
||||
)
|
||||
@@ -366,6 +366,10 @@ public class PyFormatterTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIndentParensInImport() { // PY-9075
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user