mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
"space within method declaration parentheses" code style option (PY-8818)
This commit is contained in:
@@ -46,6 +46,7 @@ public class PyLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSettin
|
||||
"SPACE_AROUND_MULTIPLICATIVE_OPERATORS",
|
||||
"SPACE_AROUND_SHIFT_OPERATORS",
|
||||
"SPACE_WITHIN_METHOD_CALL_PARENTHESES",
|
||||
"SPACE_WITHIN_METHOD_PARENTHESES",
|
||||
"SPACE_WITHIN_BRACKETS",
|
||||
"SPACE_AFTER_COMMA",
|
||||
"SPACE_BEFORE_COMMA",
|
||||
|
||||
@@ -96,6 +96,7 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C
|
||||
.around(DOT).spaces(0)
|
||||
.before(SEMICOLON).spaceIf(commonSettings.SPACE_BEFORE_SEMICOLON)
|
||||
.withinPairInside(LPAR, RPAR, ARGUMENT_LIST).spaceIf(commonSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES)
|
||||
.withinPairInside(LPAR, RPAR, PARAMETER_LIST).spaceIf(commonSettings.SPACE_WITHIN_METHOD_PARENTHESES)
|
||||
.before(LBRACKET).spaceIf(pySettings.SPACE_BEFORE_LBRACKET)
|
||||
|
||||
.withinPair(LBRACE, RBRACE).spaceIf(pySettings.SPACE_WITHIN_BRACES)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo(x, y):
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo( x, y ):
|
||||
pass
|
||||
@@ -317,6 +317,11 @@ public class PyFormatterTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSpaceWithinDeclarationParentheses() { // PY-8818
|
||||
settings().SPACE_WITHIN_METHOD_PARENTHESES = true;
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
myFixture.configureByFile("formatter/" + getTestName(true) + ".py");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user