mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 09:12:22 +07:00
Namely, for their case clauses and inner comments. Right now, each of them is indented on its own, as a separate formatting block. It's still not entirely clear whether we should have a dedicated indented container element for case clauses, similar to PyStatementList for statements. It might simplify the formatter and some editing actions, but cause confusion between the two container elements. GitOrigin-RevId: 69184d2f8f78e2e113e8f40a310bb13ac0b5e71a
27 lines
982 B
Plaintext
27 lines
982 B
Plaintext
PyFile:PatternMatchingLeadingAndTrailingComments.py
|
|
PyMatchStatement
|
|
PsiElement(Py:MATCH_KEYWORD)('match')
|
|
PsiWhiteSpace(' ')
|
|
PyReferenceExpression: x
|
|
PsiElement(Py:IDENTIFIER)('x')
|
|
PsiElement(Py:COLON)(':')
|
|
PsiWhiteSpace('\n ')
|
|
PsiComment(Py:END_OF_LINE_COMMENT)('# match leading comment')
|
|
PsiWhiteSpace('\n ')
|
|
PyCaseClause
|
|
PsiElement(Py:CASE_KEYWORD)('case')
|
|
PsiWhiteSpace(' ')
|
|
PyLiteralPattern
|
|
PyNumericLiteralExpression
|
|
PsiElement(Py:INTEGER_LITERAL)('1')
|
|
PsiElement(Py:COLON)(':')
|
|
PsiWhiteSpace('\n ')
|
|
PyStatementList
|
|
PyPassStatement
|
|
PsiElement(Py:PASS_KEYWORD)('pass')
|
|
PsiWhiteSpace('\n ')
|
|
PsiComment(Py:END_OF_LINE_COMMENT)('# case trailing comment')
|
|
PsiWhiteSpace('\n ')
|
|
PsiComment(Py:END_OF_LINE_COMMENT)('# match trailing comment')
|
|
PsiWhiteSpace('\n')
|
|
PsiComment(Py:END_OF_LINE_COMMENT)('# unrelated comment') |