Files
openide/python
Mikhail Golubev 97b22aaa13 PY-42200 Support parenthesized context managers in Python 3.9+
In case of syntactic ambiguity with previous versions of the grammar, such as
"with (expr)" or "with (expr1, expr2)", PyWithStatement is still parsed as
having its own parentheses, not a parenthesized expression or a tuple as
a single context expression. The latter case, even though syntactically legal,
is still reported by the compatibility inspection in Python <3.9.

These changes also include proper formatter and editing support (e.g. not
inserting backslashes on line breaks inside parentheses), as well as
Complete Current Statement, which now takes possible parentheses into account
while inserting a missing colon.

The changes in the formatter are somewhat ad-hoc, intended to minimize the effect
on other constructs. "With" statement is somewhat special in the sense that it's
the first compound statement (having a statement list) with its own list-like
part in parentheses.

Existing tests on with statement processing were expanded and uniformly named.

Co-authored-by: Semyon Proshev <semyon.proshev@jetbrains.com>

GitOrigin-RevId: 15c33e97f177e81b5ed23891063555df016feb05
2022-05-04 12:31:37 +00:00
..
2022-03-27 18:52:50 +00:00
2022-04-14 19:49:13 +00:00

official JetBrains project

PyCharm Community Edition

The "python" directory in the source repository contains the source code of PyCharm Community Edition and the Python plugin for IntelliJ IDEA Community Edition.

Building and Running

The code is part of the main IntelliJ IDEA Community Edition project and is compiled together with the rest of the codebase. To run PyCharm Community Edition, please use the provided run configuration "PyCharm Community Edition". To run IntelliJ IDEA with the Python plugin, please use the "IDEA with Python plugin" run configuration.

To run the test suite, use the built-in JUnit test runner and run all tests in the "python-community-tests" module.

Building from the Command Line

To build the distribution archive of PyCharm Community Edition, execute build.xml Ant build script in this directory. The results of the build execution can be found at out/artifacts.

Building the Python Plugin

To build the Python plugin for IntelliJ IDEA Community Edition:

  • Download the .tar.gz distribution of the most recent EAP or release build of IntelliJ IDEA Community Edition;

  • Run the following command:

    ant -Didea.path= -Didea.build.number=<build number of the build you're using> plugin

The .zip file of the built plugin will be placed at distCE/python-community-.SNAPSHOT.zip