mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-15 20:26:04 +07:00
PY-35627 Make Python formatter always add a line break after a decorator list
For regular non-async functions, it already worked thanks to PyTokenSeparatorGenerator. GitOrigin-RevId: b60dba7b34710cad7dc46ad6f943b3944fc00c42
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0a14ce2dea
commit
b55fd53258
@@ -122,7 +122,7 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilder, Cus
|
||||
.before(PATTERN_ARGUMENT_LIST).spaceIf(commonSettings.SPACE_BEFORE_METHOD_CALL_PARENTHESES)
|
||||
|
||||
.around(DECORATOR_CALL).spacing(1, Integer.MAX_VALUE, 0, true, 0)
|
||||
.after(DECORATOR_LIST).spacing(1, Integer.MAX_VALUE, 0, true, 0)
|
||||
.after(DECORATOR_LIST).spacing(1, Integer.MAX_VALUE, 1, true, 0)
|
||||
|
||||
.aroundInside(EQ, ASSIGNMENT_STATEMENT).spaceIf(commonSettings.SPACE_AROUND_ASSIGNMENT_OPERATORS)
|
||||
.aroundInside(EQ, TYPE_ALIAS_STATEMENT).spaceIf(commonSettings.SPACE_AROUND_ASSIGNMENT_OPERATORS)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
class C:
|
||||
async def <caret>m(self, p):
|
||||
return f'{p}'
|
||||
@@ -0,0 +1,4 @@
|
||||
class C:
|
||||
@staticmethod
|
||||
async def <caret>m(p):
|
||||
return f'{p}'
|
||||
@@ -45,4 +45,8 @@ public class PyMakeMethodStaticQuickFixTest extends PyQuickFixTestCase {
|
||||
doMultifilesTest(PyMethodMayBeStaticInspection.class, PyPsiBundle.message("QFIX.NAME.make.static"), new String[]{"test.py"});
|
||||
}
|
||||
|
||||
// PY-35627
|
||||
public void testAsyncMethod() {
|
||||
doQuickFixTest(PyMethodMayBeStaticInspection.class, PyPsiBundle.message("QFIX.NAME.make.static"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user