mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix formatting of lambda expressions
This commit is contained in:
@@ -352,7 +352,7 @@ public class PyBlock implements ASTBlock {
|
||||
if (type2 == PyElementTypes.STATEMENT_LIST) {
|
||||
return Spacing.createSpacing(1, Integer.MAX_VALUE, 0, true, 0);
|
||||
}
|
||||
if (parentType == PyElementTypes.KEY_VALUE_EXPRESSION) {
|
||||
if (parentType == PyElementTypes.KEY_VALUE_EXPRESSION || parentType == PyElementTypes.LAMBDA_EXPRESSION) {
|
||||
return getSpacingForOption(getPySettings().SPACE_AFTER_PY_COLON);
|
||||
}
|
||||
}
|
||||
@@ -387,7 +387,7 @@ public class PyBlock implements ASTBlock {
|
||||
if (type2 == PyElementTypes.ARGUMENT_LIST) {
|
||||
return getSpacingForOption(mySettings.SPACE_BEFORE_METHOD_CALL_PARENTHESES);
|
||||
}
|
||||
if (type2 == PyElementTypes.PARAMETER_LIST) {
|
||||
if (type2 == PyElementTypes.PARAMETER_LIST && type1 != PyTokenTypes.LAMBDA_KEYWORD) {
|
||||
return getSpacingForOption(mySettings.SPACE_BEFORE_METHOD_PARENTHESES);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
lambda o:o.fullName()
|
||||
@@ -0,0 +1 @@
|
||||
lambda o: o.fullName()
|
||||
@@ -135,6 +135,10 @@ public class PyFormatterTest extends PyLightFixtureTestCase {
|
||||
CodeStyleSettingsManager.getInstance().getSettings(myFixture.getProject()).ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLambdaColon() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPsiFormatting() { // IDEA-69724
|
||||
String initial =
|
||||
|
||||
Reference in New Issue
Block a user