What’s New in PyCharm 2021.1

PyCharm 2021.1: Collaborative Development, Auto-import for Module Member Completion, and Enhanced WSL Support.

Collaborative development

Collaborative development

Code With Me connects remote teams in a feature-rich remote collaborative environment. Set the required level of access and invite others to collaborate on your project with you by sharing the link with them. Your peers do not even need to have an IDE of their own installed to collaborate with you. Code With Me includes embedded audio and video calls, along with chat messaging, which will help teams discuss the code, share their knowledge, and cooperate more efficiently.

Performance

Faster indexing for projects

There are revamped prebuilt indexes for popular Python interpreters that make the standard library indexing in PyCharm much faster. This approach has also helped us decrease the size of the PyCharm installation.

WSL Pro only

Work directly with WSL projects

Work directly with WSL projects

You can now work directly with projects located in the WSL filesystem. With PyCharm you can now open any directory in \\wsl$. If the IDE detects a Python file in the directory, it will suggest creating a WSL-based interpreter. It also detects if there is an existing WSL interpreter. For version control, you can use the version of Git installed on your WSL instance.

Code insight

Auto import on module member completion

Auto import on module member completion

PyCharm now automatically adds an import statement when you refer to a module or package name in your code and invoke code completion, which provides a list of available module members. Auto-import on code completion is also applied to some popular package name aliases, such as np for NumPy or pd for pandas.

Intelligent completion for multiple arguments

Intelligent completion for multiple arguments

PyCharm now recognizes methods that have several parameters with defined arguments. When you invoke code completion for such methods, PyCharm analyzes the context and offers completion suggestions for all parameters with local variables that have the same name.

Type suggestions for decorated methods

Type suggestions for decorated methods

PyCharm can validate the types of decorated methods based on the types and type hints of their decorators.

Further improvements

  • PyCharm now includes an inspection that highlights http:// protocol usages in strings and offers to change them to https://. You can add URLs to the list of ignored URLs or disable the inspection for the whole project or parts of it in Preferences/Settings | Editor | Inspections | Security – Link with unencrypted protocol.
  • PyCharm now correctly parses mypy # type: ignore comments and suppresses type checker errors in the editor.
  • PyCharm now type checks Cython files. Only numeric types are currently supported.

IDE improvements

Tool window for Python packages

Tool window for Python packages

Install a new Python package or browse through all the packages available for download using the new Python Packages tool window, without having to leave the editor. You can open it from the main menu at any time: View | Tool Windows | Python Packages.
The Python Packages tool window will show all the installed packages and all the packages that are available in the PyPI repository.

Built-in HTML preview

Built-in HTML preview

A new built-in browser preview allows you to quickly preview HTML files. Any changes you make to HTML files in the IDE, as well as in the linked CSS and JavaScript files, will be immediately saved and the preview will update on the fly. To open the preview, click on the icon with the PyCharm logo in the widget in the top-right corner of the editor.

Maximized tab view in split editor mode

Maximized tab view in split editor mode

You can now double-click on a tab in split mode to maximize it. Double-click it again to restore it to its original size.

Version Control

Configure a profile for pre-commit inspections

Configure a profile for pre-commit inspections

Choose a code inspection profile before committing changes to VCS. To access this feature, click the gear icon on the divider panel in the Commit tool window to display the commit options, select the Analyze code checkbox, click Configure, and choose the desired profile. Profiles can be created in Preferences / Settings | Editor | Inspections.

Further improvements

  • Use Git commit templates to create custom commit messages to suit on your needs. If you define a commit template, the IDE will display the text from it as an initial commit message.
  • Copy your changes to the Shelf while keeping them in the local changes with the Save to Shelf action. You can access this action by pressing Ctrl+Shift+A and typing ‘Save to Shelf’.
  • Connect PyCharm to your organization in JetBrains Space to view and clone project repositories and to review your teammates’ code. To log in to Space, click the Get from VCS button on the Welcome screen, select Space on the left, and enter your organization URL in the dedicated field.

Frontend development Pro only

Bundled MDN documentation

Bundled MDN documentation

MDN documentation is now bundled with PyCharm. This will help prevent connectivity issues with the MDN website and make in-editor documentation in your HTML, CSS, and JavaScript files display more quickly. In-editor documentation will also become more informative – for example, you’ll now see details about supported browser versions for JavaScript APIs.

Improved support for Stylelint

Improved support for Stylelint

Inspecting your CSS code with Stylelint is now easier. You can now fix problems with this popular linter in just a few clicks. Hover over a problem in your file or place the caret on it and press Alt+Enter, then select Stylelint: Fix current file.
Additionally, you can now specify a path to the configuration file under the corresponding field in Preferences / Settings | Languages & Frameworks | Style Sheets | Stylelint.

Selector specificity for CSS

Selector specificity for CSS

When working with style sheets, you can now check the specificity of your selectors – just hover over a selector that you want to check. Alternatively, focus on a selector and press F1/Ctrl+Q (F1/Ctrl+J) to see this information in the Documentation popup.

Databases Pro only

Order and export selected query

Order and export selected query

We’ve added the new ORDER BY field, which lets you reorganize the table by applying a clause to a database table query. You can use stacked sorting by clicking on a column name while holding the Alt key. You can also now export filtered and ordered queries.

Direct editing support for MongoDB

Direct editing support for MongoDB

You can now use the UI to change the type of a field or edit data in MongoDB collections. Type changing can be done both in the context menu of the field and in the value editor.

Please note that features marked Pro only are supported only in PyCharm Professional Edition.