What’s New in PyCharm 2024.3

Inline AI prompting and coding assistance for the dataclass_transform decorator

AI Assistant

Inline AI prompting

Prompt AI directly in the editor

You can interact with AI Assistant right where you do most of your work – in the editor. Stuck with an error in your code? Need to add documentation or tests? Just start typing your request on a new line in the editor. PyCharm will automatically recognize your natural language request and generate a response. If the new line is indented, prefix your request with the $ or ? symbol.

PyCharm leaves a purple mark in the gutter next to lines changed by AI Assistant so you can easily see what has been updated.

If you don’t like the initial suggestion, you can generate a new one by pressing Tab. You can also adjust the initial input by clicking on the purple block in the gutter or simply pressing Ctrl+\ for Windows or Cmd+\ for macOS.

This feature is available for Python, JavaScript, TypeScript, JSON, and YAML files.

Narrow the context for your inline prompt

Want to get assistance with a specific argument? You can narrow the context that AI Assistant uses for its response as much as you want. Just put the caret in the relevant context, type the $ or ? symbol, and start writing. PyCharm will recognize your prompt and take the current context into account for its suggestions.

Generate documentation

PyCharm now displays a Generate with AI Assistant inlay hint when it detects the docstring format. This feature helps you leverage AI to speed up the process of generating documentation.

Improved context management

In this update, we’ve made managing the context AI Assistant takes into account with its suggestions more transparent and intuitive. A revamped UI lets you view and manage every element included as context, providing full visibility and control. The open file and any selected code within it are now automatically added to the context, and you can easily add or remove files as needed, customizing the context to fit your workflow. Additionally, you can attach project-wide instructions to guide AI Assistant’s responses throughout your codebase.

Option to choose a chat model provider

You can now select your preferred AI chat model, choosing from Google Gemini, OpenAI, or local models on your machine. This expanded selection allows you to customize the AI chat’s responses to fit your specific workflow, offering a more adaptable and personalized experience.

Run code from the AI chat in the Python console

Iterate faster on the code suggested by AI Assistant by simply running code snippets from the AI chat in the Python console. Click the green Run button in the upper right-hand corner of the code snippet to check how the suggested piece of code works.

Instant access to PyCharm docs

AI Assistant can now suggest the best way to perform a given task in PyCharm based on the latest state of PyCharm’s documentation. Use the /docs command to get tailor-made hints on how to accomplish your tasks most efficiently.

Ability to recognize dataframes and variables in prompts

AI Assistant is now able to work with dataframes and variables in your notebooks. Simply use # before the name of a dataframe or variable, and AI Assistant will help you analyze it. AI Assistant has direct access to the dataframe’s summary and statistics, which allows it to provide you with the best possible results.

Additionally, you can navigate to the Variables view of the Jupyter tool window straight from the chat. Simply click on the paperclip icon in your mention of the dataframe or variable.

Ability to convert for loops into list comprehensions

Refactor your code faster with AI Assistant, which can now help you change massive for loops into list comprehensions. This feature works for all for loops, including nested and while loops.

SQL error handling by AI Assistant

We have implemented a couple of useful actions for handling SQL query execution errors with AI Assistant. Now, for each error message, PyCharm shows two actions on the far right-hand side of the error message: Explain with AI and Fix with AI.

Explain with AI opens the AI chat, sends an automatic prompt, and gives you AI Assistant’s explanation of the error.

Fix with AI generates a fix for the query execution error in the editor.

These two new actions work similarly to the Fix SQL Problem Under Caret and Explain SQL Problem Under Caret intention actions.

This feature requires attaching the database schema to suggest proper explanations and fixes.

Local multiline AI code completion PyCharm Professional

PyCharm Professional now provides local multiline AI code completion suggestions based on the proprietary JetBrains ML model used for full line code completion. Note that we don’t use your data to train the model.

Local multiline code completion typically generates 2–4 lines of code in scenarios where it can predict the next sequence of logical steps, such as within loops, when handling conditions, or when completing common code patterns and boilerplate sections.

Python

Coding assistance for the dataclass_transform decorator (PEP 681)

When you are working with custom data classes created via libraries that use the dataclass_transform decorator, the IDE now provides you with all the intelligent coding assistance it offers for standard data classes. For instance, you can enjoy code completion for attributes and type inference for constructor signatures.

Jupyter Notebook PyCharm Professional

Auto-installation for multiple packages

PyCharm 2024.3 makes it easier to install packages that are imported in your code. A new quick-fix is available for bulk auto-installations, allowing you to download and install several packages in one click.

Ability to run specific lines in the Jupyter console

PyCharm now allows you to run selected lines of code directly in the Jupyter console without executing the entire cell. This feature makes it easy to quickly debug or check outputs of specific pieces of code, bringing more flexibility and efficiency to your workflow.

Ability to open Jupyter table outputs in the Data View window

View Jupyter table outputs in the Data View tool window to access powerful features like heatmaps, formatting, slicing, and AI functions for enhanced dataframe analysis. Just click on the Open in Data View icon to get started.

Inline renaming for local variables and functions

You can now rename local variables, functions, and symbols directly in the editor without having to open a dialog. Just select the entity you want to rename and press Shift+F6.

Data View PyCharm Professional

No-code data filtering

You can now filter the data in the Data View tool window and in dataframes without writing a single line of code. Click on the Filter icon located in the upper right-hand corner of the tool window or a dataframe, and then select the filtering options you would like to use. Filter results can be observed right away in the same window.

This functionality works with all supported Python frameworks, including pandas, Polars, NumPy, PyTorch, TensorFlow, and Hugging Face Datasets.

User experience

Highlight occurrences of selected text

By default, PyCharm will now automatically highlight all instances of the text you select within a file. This makes it easier to track where your selected text appears throughout your code. You can customize the feature in Settings | Editor | General | Appearance.

Spelling and grammar checks during indexing

Building on the progress made in the 2024.2 release, we’re increasing the number of essential features that are available while the project model is being built and indexed. In version 2024.3, spelling and grammar checks are accessible even while indexing is in progress. This allows you to catch errors, such as those in Markdown documents and documentation tags, without waiting for indexing to finish.

Optimized placement for the Rename action

We’ve optimized the placement of the Rename action in the context menu when called on elements in the editor and the Project tool window. The action is now at the top level, making it easier for users who frequently rely on the mouse to quickly rename files, variables, and other elements.

Run widget: Option to launch multiple configurations simultaneously

The updated Run widget lets you launch multiple configurations simultaneously by holding Ctrl and clicking the Debug icon in the popup. Additionally, the widget displays controls for all running configurations, providing a clear overview of their statuses and simplifying management.

Increased default tab limit

We’ve increased the default tab limit in the editor to 30. This means you can now keep more tabs open before the IDE starts closing the ones used least recently. You can control this setting in Settings | Editor | General | Editor Tabs.

Debugger

Debug port specification PyCharm Professional

PyCharm now allows you to specify a single debugger port for all communications, simplifying debugging in restricted environments like Docker or WSL. After you set the port in the debugger settings, the debugger runs as a server and all communication between it and the IDE flows through the specified port.

Databases PyCharm Professional

Floating pagination toolbar

To make grid paging more noticeable in the data editor, we have moved the control from the toolbar to the bottom center of the data editor.

Inspection for an excessive number of JOIN clauses

In certain cases, running a query that contains an excessive number of JOIN clauses is not recommended due to performance degradation. The editor can now identify and highlight such queries. You can enable this inspection in the IDE settings. To do so, navigate to Editor | Inspections, expand the SQL section, and select Excessive JOIN count.

Fragment introspection and smart refresh for MySQL and MariaDB

PyCharm now supports fragment introspection. Previously, the introspector could perform only a full introspection of schemas in the MySQL or MariaDB databases but not refresh the metadata of a single object. Every time a DDL statement was executed in the console and that execution could modify an object in the database schema, the IDE would start a full introspection of the entire schema. This was time-consuming and often disrupted the workflow.

Now, PyCharm can analyze a DDL statement, determine which objects could have been affected by it, and refresh only those objects. If you select a single item in Database Explorer and call the Refresh action, only one object will be refreshed, instead of the entire schema as was previously the case.

Web development PyCharm Professional

Improved framework component navigation and renaming

We’ve enhanced in-editor hints for Vue, Svelte, and Astro components. The Show component usages action now finds usages in both imports and markup templates. We’ve also added a Show Component Usages filter to exclude component usages when searching for regular file references. The Rename refactoring has also been updated with an option to include usages when renaming a component file.

Cleaner search results for directories

PyCharm now excludes node_modules results by default when using Find in Files in project directories, reducing clutter from irrelevant files. You can restore the previous behavior by enabling the Search in library files when “Directory” is selected in Find in Files option under Settings | Advanced Settings.

VCS

Title and description generation for pull and merge requests

AI Assistant now helps generate accurate titles and descriptions for your pull and merge requests directly from the IDE, streamlining your workflow and ensuring your descriptions are clear and concise.

Updates to Find in Files

The Find in Files feature has been enhanced with a new search scope, Project Files Excluding Git-Ignored. This option excludes any files ignored in .gitignore files from your search results, helping you focus only on the relevant code when searching through your project.

Option to disable background pre-commit checks

You can now manage background checks during the commit process with a new Run advanced checks after a commit is done option under Settings | Version Control | Commit. This setting lets you decide if tests and inspections should run after making a commit. If you want these checks to be completed before the commit happens, simply disable it.

Frameworks and technologies PyCharm Professional

HTTP Client updates

PyCharm 2024.3 introduces the ability to access environment variables directly within the HTTP Client using the $env.ENV_VAR syntax. This allows for more flexibility when managing and using variables within your requests and scripts. In addition, it is now possible to run requests from an included .http file — all at once or specific request by name — and override variables.

Enhanced Dev Containers support

Dev Containers builds now work more smoothly on remote Docker engines, preventing errors when local directories aren’t accessible remotely. Stability in WSL has also been enhanced, with improved image builds and reliable connections.

The devcontainer.json file processes features more consistently, and the new updateRemoteUID option avoids access conflicts by setting the correct user identity. IDE settings in Dev Containers can be customized through devcontainer.json files or via the Add currently modified settings from IDE button, with autocompletion for all available options.

New terminal improvements Beta

The new terminal now offers enhanced command processing, and the alignment of its UI has been refined, delivering a smoother, more intuitive experience. The terminal is now more responsive and processes prompts faster. Session switching is now seamless, with consistent state retention across tabs to ensure your workflow is not interrupted. Autocompletion accesses command names, flags, and paths more quickly, reducing manual input. We've also introduced additional customization options, including for prompt styles, session names, and environment variables, giving you greater control over your terminal environment.

Kubernetes cluster logs

PyCharm now offers cluster-wide Kubernetes log access with streaming and pattern matching – essential tools for developers, as well as DevOps and SRE teams. This feature provides a centralized view of all events across pods, nodes, and services, helping you quickly identify issues without manually checking each log. Real-time streaming enables immediate diagnostics, while pattern matching automates the detection of key events and errors, such as out-of-memory issues or unusual network activity. Learn more about this feature and how to use it in this blog post.

Docker Compose improvements

PyCharm 2024.3 provides extended support for Docker Compose. It now prioritizes .env files in env_file autocompletion, making environment setup faster. New build options—cache_to, no_cache, tags, and platforms—offer greater control over caching and platform targeting. Enhanced handling of depends_on.required and depends_on.restart allows for more effective management of the startup and shutdown order of dependent containers.

New keys like deploy.placement.preferences, deploy.resources.pids, and deploy.resources.reservations.devices allow for flexible service placement and resource limits. Multi-context builds and privileged builds are now supported via build.additional_contexts and build.privileged.

Additional options include cgroup configurations, custom extra_hosts mappings, and healthcheck.start_interval. Enhanced port settings and secrets.environment now streamline secret management via environment variables.

OpenTofu and Terraform enhancements

Support for OpenTofu is now available. This update includes autocompletion for encryption methods, key providers, and inspections for unknown references.

Terraform Run Configuration actions are accessible through Search Everywhere, and the IDE automatically detects unused variables and locals to keep your code clean. The controls for Init, Validate, Plan, Apply, and Destroy have been refined, and the Run Configuration form has been streamlined. Also, improved usage indicators and warnings for unused resources enhance navigation and help you identify inactive code.