mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
spacing in py3 annotations (PY-8961)
This commit is contained in:
@@ -84,6 +84,7 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C
|
||||
.afterInside(GT, ANNOTATION).spaces(1)
|
||||
.betweenInside(MINUS, GT, ANNOTATION).none()
|
||||
.beforeInside(ANNOTATION, FUNCTION_DECLARATION).spaces(1)
|
||||
.beforeInside(ANNOTATION, NAMED_PARAMETER).none()
|
||||
|
||||
.between(allButLambda(), PARAMETER_LIST).spaceIf(commonSettings.SPACE_BEFORE_METHOD_PARENTHESES)
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo(x : int):
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo(x: int):
|
||||
pass
|
||||
@@ -66,6 +66,10 @@ public class PyFormatterTest extends PyTestCase {
|
||||
}
|
||||
|
||||
public void testStarExpression() { // PY-1523
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
private void doTestPy3() {
|
||||
PythonLanguageLevelPusher.setForcedLanguageLevel(myFixture.getProject(), LanguageLevel.PYTHON30);
|
||||
try {
|
||||
doTest();
|
||||
@@ -304,6 +308,10 @@ public class PyFormatterTest extends PyTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testSpaceInAnnotations() { // PY-8961
|
||||
doTestPy3();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
myFixture.configureByFile("formatter/" + getTestName(true) + ".py");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user