mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more keywords which allow only 1 space around them
This commit is contained in:
@@ -105,9 +105,12 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C
|
||||
.around(BITWISE_OPERATIONS).spaceIf(commonSettings.SPACE_AROUND_BITWISE_OPERATORS)
|
||||
.around(EQUALITY_OPERATIONS).spaceIf(commonSettings.SPACE_AROUND_EQUALITY_OPERATORS)
|
||||
.around(RELATIONAL_OPERATIONS).spaceIf(commonSettings.SPACE_AROUND_RELATIONAL_OPERATORS)
|
||||
.around(IN_KEYWORD).spaces(1);
|
||||
.around(SINGLE_SPACE_KEYWORDS).spaces(1);
|
||||
}
|
||||
|
||||
// should be all keywords?
|
||||
private static final TokenSet SINGLE_SPACE_KEYWORDS = TokenSet.create(IN_KEYWORD, AND_KEYWORD, OR_KEYWORD, IS_KEYWORD);
|
||||
|
||||
private static TokenSet allButLambda() {
|
||||
final PythonLanguage pythonLanguage = PythonLanguage.getInstance();
|
||||
return TokenSet.create(IElementType.enumerate(new IElementType.Predicate() {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
True and False
|
||||
@@ -0,0 +1 @@
|
||||
True and False
|
||||
@@ -183,6 +183,10 @@ public class PyFormatterTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSpaceAroundKeywords() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPsiFormatting() { // IDEA-69724
|
||||
String initial =
|
||||
"def method_name(\n" +
|
||||
|
||||
Reference in New Issue
Block a user