What’s New in PyCharm 2024.2

Use AI Assistant for data analysis directly in the improved interface for Jupyter notebooks and work more efficiently with Hugging Face models

Download

AI Assistant

JetBrains AI Assistant 2024.2 introduces significant enhancements to cloud code completion, offering more accurate and faster suggestions. The UX has been reworked to better integrate AI code completion features into IDE workflows, with improvements like syntax highlighting in suggested code and incremental acceptance of code suggestions. The AI chat has also become smarter, now supporting the latest GPT-4o model, chat references, and semantic search.

New features include AI integration in the Terminal tool window for efficient command generation and AI-assisted VCS conflict resolution. Additionally, users can now customize prompts for documentation generation and unit test creation, tailoring them to specific coding standards and languages.

Learn about these and other enhancements in the blog post.

AI cells in Jupyter notebooks

AI Assistant is now even more deeply integrated into Jupyter notebooks in PyCharm. You now have the option to add a prompt directly inside your notebook and work with AI Assistant right from there. Just choose the AI cell option that appears above or below each cell, and a cell with a field that’s ready for your prompt will appear.

If you get stuck while performing data analysis and would like a hint about the most common steps that other data analysts usually perform at that stage, click on the bulb on the right side of the AI cell. AI Assistant will provide the most relevant suggestions based on the notebook’s current context so that you can clean your data faster and more efficiently.

If you would like AI Assistant to help you iterate on the code of a particular cell, use the AI Edit Cell option from the context menu. This will open the field for the prompt directly in the selected cell. Changes suggested by AI Assistant will be shown in a diff view so that you can see how your code will be changed.

One-click dataframe visualization

Visualize your dataframes with the help of AI Assistant, which can now provide suggestions about the graphs and plots most suitable to your context.

Use the AI icon in the upper right-hand corner of the dataframe and select Suggest Visualization. PyCharm will then open an AI chat where you’ll receive suggestions. Choose the one you like best, and AI Assistant will generate a new cell with the appropriate code snippet in the notebook. Run it, and voilà! The graph will appear in your notebook.

Databricks integration

PRO

PyCharm now provides direct integration with Databricks. You can connect to a Databricks cluster, execute scripts and notebooks as workflows, execute files directly in a Spark shell on a cluster, and monitor the progress – all from the comfort of your IDE.

PyCharm can detect Databricks configuration files on your disk and use them to connect to Databricks clusters. You can run code in Databricks in two modes: Run on Cluster or Run as a Workflow.

To use the Databricks integration, you must install this dedicated plugin.

Hugging Face integration

PRO

Model suggestions

PyCharm can now suggest a list of relevant Hugging Face models that best suit your needs. This allows you to decide which model to use and install it without ever having to leave the IDE. Right-click in the editor tab to call the context menu, choose Insert HF Model, and identify what you would like the model to do. PyCharm will provide a list of suggestions! After you select a model, PyCharm will suggest inserting a code snippet that allows you to use this model directly in the open file, and it will download and install all the missing packages on which this model depends.

Interactive dataframes for the Hugging Face Datasets library

You can now inspect your Hugging Face Datasets library data as an interactive dataframe. This allows you to take advantage of the features you already use for pandas, Polars, PyTorch, and TensorFlow dataframes, including the chart view, pagination, and the ability to sort and export tables.

Option to identify and delete unused models

A new dedicated Hugging Face tool window allows you to monitor and manage Hugging Face models stored on your machine. This will help you identify unused models that can be deleted to free up disk space, in addition to making it easy to copy the paths to models or open the folders where they are stored.

Jupyter notebooks

PRO

Inline variable preview

You no longer need to start the debugger or use a print statement if you just want to check variable values. You can now get an instant preview of the values of a chosen variable simply by putting the cursor on the variable’s line.

UX for Jupyter notebooks

Streamlined cell execution

The Run button is now located next to each cell, so you no longer need to navigate to the upper menu, and a new Go To button allows you to navigate to the cell that was run most recently.

Additionally, each cell now displays its status, specifying whether it already ran successfully, it ran with an error, or its execution was canceled. You can check the execution status by hovering over the Go To button on the notebook’s main toolbar. When the cell is finished running, PyCharm shows a notification, even if the notebook has since been closed.

Tags

Assigned tags for each cell are now visible in the editor. You can add new tags via the context menu.

Ability to expand and collapse code and Markdown cells

To make the most out of your working space in the notebook, you can now expand and collapse both code and Markdown cells. The cell in focus is highlighted with a blue line, and clicking on this line collapses or expands the cell’s content and output. Cells not in focus can also be collapsed. Hover over one to reveal a gray line, which you can then click.

The Endpoints tool window: Support for @action for Django REST Framework viewsets

PRO

The Endpoints tool window recognizes routes specified via the @action decorator for viewsets. You can see the routes and HTTP methods specified in the methods parameter. Further, PyCharm now generates routes based on the detail and url_path parameters in addition to the initial route assigned to the viewset. The HTTP Client will suggest a request with the relevant methods for each route.

User experience

Preview option in Search Everywhere

The Search Everywhere dialog now includes an option to preview the codebase elements you’re searching for. Enabling this feature through the Preview icon on the dialog’s toolbar will cause a preview pane to appear under the search results, offering additional context and making it easier to navigate through your project.

Improved full line code completion

PRO

In version 2024.2, we’ve made the process of accepting full line code completion suggestions more intuitive and precise. Inline code completion suggestions now include code highlighting, and new shortcuts allow you to accept individual words or entire lines from longer suggestions. We’ve also refined how accepted changes are integrated into your code, eliminating formatting and related issues.

Further improvements

  • The new UI has been made the default for all users. With PyCharm 2024.2, the new UI is now the default for all users, leaving the classic one available as a plugin. Learn more about the new UI
  • PyCharm now automatically detects system proxy settings configured on your machine and uses them by default.

Code editor

Support for math syntax in Markdown files

PyCharm can now natively render mathematical expressions in Markdown files. When working with Markdown, you can use $ to insert inline math expressions and $$ for code blocks with math content.

Language-aware sticky lines

You can now choose the languages you want sticky lines to appear for. You can tailor the feature to your preferences either in Settings/Preferences | Editor | General | Sticky Lines or by calling the context menu with a right-click on a sticky line in the editor.

Run/Debug

String variable visualizers for JSON, XML, and other formats

Debugging and browsing long string variables with complex data formats is now much easier. The updated debugger offers properly formatted visualizations for string variables with strings encoded in JSON, XML, HTML, JWT, and URL. Simply click the View hyperlink next to a variable to quickly identify the root cause of your bug. The relevant visualizer is automatically chosen based on the contents of your variable.

Test coverage for changes in the current feature branch

PyCharm 2024.2 further improves your ability to quickly check and improve test coverage locally without needing to go through the slow process of using the CI/CD pipeline. The Coverage tool window now shows only the classes that have been changed in your current feature branch, allowing you to check the test coverage for your recent changes without browsing the entire project status. To review the entire project’s test coverage and see all classes, disable the Show Only Modified Classes option.

Version control systems

Tags in the Version Control widget

We’ve given tags a dedicated node in the Version Control widget, making it easier to check them out. The node is displayed by default, but if you prefer to hide it, simply click the gear icon and uncheck the Show Tags option.

Further improvements

  • There are two new options under the Graph Options icon in the Git tool window: --first-parent and --no-merges. Use the First Parent option to focus on the mainline changes by hiding individual commits from merges. Alternatively, you can filter out merge commits entirely with the No Merges option.
  • To simplify reviewing changes in complex projects, we’ve made the Local History action available for multiple files or directories simultaneously. In the Project tool window, select multiple files or folders and choose Local History | Show History to view a popup with the change history for your selections.
  • You can now open the Git log as a tab in the editor, providing more workspace and easier navigation through the list of commits and related details. This action is also available through the drop-down menu in the Log tool window’s toolbar.
  • We’ve refined the color encoding and layout of branch lines for the commit graph in the Log tab of the Git tool window. Important branch lines now consistently remain on the left-hand side of the graph and retain their designated colors, making them easier to identify and follow.

Frameworks and technologies

PRO

GraalJS as the execution engine for the HTTP Client

We’ve upgraded the JavaScript execution engine used in the HTTP Client to GraalJS. This allows you to use all GraalJS features, including full support for the ECMAScript 2023 specification, when testing endpoints with PyCharm’s HTTP Client and using JavaScript in .http files to handle the results.

HTTP Client improvements

We’ve introduced valuable updates to the HTTP Client. The new XPath function allows you to query elements directly from XML and HTML documents. Additionally, we’ve added numerous methods for manipulating XML and HTML documents, eliminating the need to parse XML manually.

The HTTP Client now also supports iterating through variable collections, allowing you to compose a single HTTP request with a JSONPath collection and automatically send requests for each element in the collection. Furthermore, you can access specific collection items in post-processing scripts using JSONPath syntax.

Additionally, we’ve implemented the ability to create custom methods for working with APIs that provide specific methods. You can now add custom methods on the fly with a quick-fix or enter them with a comma-separated list in Settings | Tools | HTTP Client.

Enhanced Terraform support

We’ve significantly extended PyCharm’s coding assistance for Terraform by making full line code completion available for it. Additionally, essential code insight features such as context-aware code completion, refined syntax highlighting, and the error detection system with quick-fix suggestions have been improved for Terraform. We've also added a quick documentation feature that displays tooltips when you hover over elements, providing instant information to help you use Terraform resources more effectively without interrupting your workflow.

Database tools

PRO

New AI Assistant features

In this release, we’re introducing new AI Assistant features for databases. With the text-to-SQL feature, you can generate SQL code directly in the editor by clicking Generate Code with AI and entering your prompt. You can accept, regenerate, or refine the code, and take it to the AI chat if you have further questions.

Additionally, AI Assistant can help with modifying tables, allowing you to request changes like switching all VARCHAR data types to CHAR. It can also help you understand and fix SQL problems, suggesting explanations and fixes. In addition, you can attach your database schema to the AI chat by mentioning it in your prompt.

Customizable data import via scripted loaders

You can now import data from tabular files using customizable scripted loaders for the Excel, JSON, Parquet, and shapefile formats. Drag your file from the Project tool window to the schema in the database explorer and configure the settings in the Import dialog.

In addition, you can view these files in the data editor with a single click in the Project tool window. To disable this behavior, go to Settings/Preferences | Advanced Settings | Open file as table if detected by scripted loader.

You can also create custom loaders by placing them in Scratches and Consoles | Extensions | Database Tools and SQL | data | loaders.

Further improvements

  • Access rows related to a given cell by selecting the cell and then clicking the Related Rows icon. The Navigate And Select First option shows all rows, highlighting the first ones referenced, while the Navigate And Filter All option shows only the referenced rows.
  • We've made value completion automatic. Keep in mind that this feature operates entirely locally, so completion variants are based on the other values already loaded in the current column.

Frontend

PRO

Ability to run and debug TypeScript files directly

You can now run and debug TypeScript files without any additional setup. You can execute them from different entry points, including the file context menu, the Run widget, and the Current File configuration.

Improved support across major web frameworks

PyCharm 2024.2 is able to resolve paths for frameworks that use file-system-based routing. It can resolve link paths based on your project's file system, providing autocompletion and navigation for Next.js, Nuxt, SvelteKit, and Astro. There is also support for new Svelte 5 snippets and render tags. Additionally, we’ve implemented language server protocol (LSP) support for Astro and Vue Language Service v2, improving code completion and the overall developer experience.

Other improvements

Reverse port forwarding for remote development

PRO

We've added reverse port forwarding for remote development workflows. This new feature allows the remote IDE to connect to ports available on the client machine. It is particularly useful for mobile development and connecting to local databases.

JetBrains Runtime: Switch to JBR 21

We’re transitioning from JetBrains Runtime 17 (JBR17) to JetBrains Runtime 21 (JBR21). Starting with PyCharm 2024.2, all IDE updates will come with JBR21, offering enhanced security and performance as well as Wayland rendering support for Linux.

Download