mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't indent closing paren of tuple (PY-7946)
This commit is contained in:
@@ -192,9 +192,13 @@ public class PyBlock implements ASTBlock {
|
||||
childIndent = Indent.getNormalIndent();
|
||||
}
|
||||
}
|
||||
else if ((parentType == PyElementTypes.PARENTHESIZED_EXPRESSION || parentType == PyElementTypes.GENERATOR_EXPRESSION) &&
|
||||
hasLineBreaksBefore(child, 1)) {
|
||||
childIndent = Indent.getNormalIndent();
|
||||
else if ((parentType == PyElementTypes.PARENTHESIZED_EXPRESSION || parentType == PyElementTypes.GENERATOR_EXPRESSION)) {
|
||||
if (childType == PyTokenTypes.RPAR || !hasLineBreaksBefore(child, 1)) {
|
||||
childIndent = Indent.getNoneIndent();
|
||||
}
|
||||
else {
|
||||
childIndent = Indent.getNormalIndent();
|
||||
}
|
||||
}
|
||||
|
||||
if (isAfterStatementList(child) && !hasLineBreaksBefore(child, 2)) { // maybe enter was pressed and cut us from a previous (nested) statement list
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
tuple = (
|
||||
'value',
|
||||
'value',
|
||||
)
|
||||
@@ -0,0 +1,4 @@
|
||||
tuple = (
|
||||
'value',
|
||||
'value',
|
||||
)
|
||||
@@ -4,4 +4,4 @@ if True:
|
||||
'\n'
|
||||
' Let\'s go.\n'
|
||||
' And they went out.'
|
||||
)
|
||||
)
|
||||
@@ -199,7 +199,10 @@ public class PyFormatterTest extends PyTestCase {
|
||||
public void testSpaceWithinBraces() { // PY-8069
|
||||
settings().getCustomSettings(PyCodeStyleSettings.class).SPACE_WITHIN_BRACES = true;
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTupleClosingParen() { // PY-7946
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPsiFormatting() { // IDEA-69724
|
||||
|
||||
Reference in New Issue
Block a user