mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
Previously, we acknowledged them in PythonIndentingProcessor.adjustBraceLevel, inserting synthetic STATEMENT_BREAK in front of them to stop recovery in the parser, similarly to how we handle other kinds of incomplete brackets, but the state inside PyLexerFStringHelper was not reset, so it kept trying to find matching closing brackets, quotes and interpreting colons as PyTokenTypes.FSTRING_FRAGMENT_FORMAT_START instead of just PyTokenTypes.COLON. The state in PyLexerFStringHelper and PythonIndentingProcessor became out of sync, which led to assertion violations. It's not an optimal solution, since now these tokens are listed both in PythonTokenSetContributor.getUnbalancedBracesRecoveryTokens and in Python.flex lexer specification, and we need to keep them in sync. Also, PythonTokenSetContributor can provide additional tokens from other languages, such as Cython. But it's simple and seems "good enough" to patch the problem in the release. GitOrigin-RevId: 4e156314cc02aba0634d5d9e3008177f49105051
19 B
19 B