mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
space around more keywords (PY-7863)
This commit is contained in:
@@ -109,7 +109,11 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C
|
||||
}
|
||||
|
||||
// should be all keywords?
|
||||
private static final TokenSet SINGLE_SPACE_KEYWORDS = TokenSet.create(IN_KEYWORD, AND_KEYWORD, OR_KEYWORD, IS_KEYWORD);
|
||||
private static final TokenSet SINGLE_SPACE_KEYWORDS = TokenSet.create(IN_KEYWORD, AND_KEYWORD, OR_KEYWORD, IS_KEYWORD,
|
||||
IF_KEYWORD, ELIF_KEYWORD, FOR_KEYWORD, RETURN_KEYWORD, RAISE_KEYWORD,
|
||||
ASSERT_KEYWORD, CLASS_KEYWORD, DEF_KEYWORD, DEL_KEYWORD,
|
||||
EXEC_KEYWORD, GLOBAL_KEYWORD, IMPORT_KEYWORD, LAMBDA_KEYWORD,
|
||||
NOT_KEYWORD, WHILE_KEYWORD, YIELD_KEYWORD);
|
||||
|
||||
private static TokenSet allButLambda() {
|
||||
final PythonLanguage pythonLanguage = PythonLanguage.getInstance();
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
def rc(s):
|
||||
return s.translate('*****************************************************************TVGHEFCDIJMLKNOPQYSAUBWXRZ[\]^_`tvghefcdijmlknopqysaubwxrz*************************************************************************************************************************************')[::-1]
|
||||
@@ -0,0 +1,4 @@
|
||||
def rc(s):
|
||||
return s.translate(
|
||||
'*****************************************************************TVGHEFCDIJMLKNOPQYSAUBWXRZ[\]^_`tvghefcdijmlknopqysaubwxrz*************************************************************************************************************************************')[
|
||||
::-1]
|
||||
@@ -1,3 +1,3 @@
|
||||
# "DeMorgan Law" "true"
|
||||
if not(not a and not b):
|
||||
if not (not a and not b):
|
||||
pass
|
||||
@@ -1,3 +1,3 @@
|
||||
# "DeMorgan Law" "true"
|
||||
if not(a and b):
|
||||
if not (a and b):
|
||||
pass
|
||||
@@ -4,5 +4,5 @@ c = True
|
||||
d = False
|
||||
|
||||
#before intention
|
||||
if not(not(a and b and c) and not d):
|
||||
if not (not (a and b and c) and not d):
|
||||
print "before"
|
||||
|
||||
@@ -187,6 +187,10 @@ public class PyFormatterTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSpaceAfterReturn() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPsiFormatting() { // IDEA-69724
|
||||
String initial =
|
||||
"def method_name(\n" +
|
||||
|
||||
Reference in New Issue
Block a user