IntelliJ IDEA News

AI Assistant Update – August 2023

Read this post in other languages:

AI Assistant is a major new feature of the JetBrains IDE family in the 2023.2 release, offering integration of large language models into the IDE development workflow. The AI Assistant plugin is not bundled with the IDEs and needs to be installed separately from JetBrains Marketplace. One of the primary reasons for this decision was to enable us to release new AI-powered features outside of the regular release cycle of our IDEs. This blog post describes the first batch of features added after the initial announcement.

AI Assistant Usage Restriction

When we first announced the AI Assistant, many customers stated that they would need to restrict its use, due to company policies that do not allow source code to be shared with third parties. We’d like to stress that any such sharing can only happen after the user installs the AI Assistant plugin and logs in to the JetBrains AI service – in other words, after the user performs several explicit actions to authorize the sharing. 

To provide more explicit control beyond individual developer level, we now allow teams to restrict the use of AI Assistant by creating a .noai file in the root directory of the project. When this file is present, all AI Assistant features will be fully disabled in the project.

Note that this file affects only the JetBrains AI Assistant plugin and does not affect any third-party AI integration plugins for JetBrains IDEs or other tools that may send code to external LLMs.

In the future, we’ll continue looking into other ways to provide organizations with control over the use of AI Assistant.

Prompt Library

Some of the features available in the initial version of AI Assistant (Suggest refactoring, Find potential problems) are nothing more than pre-written prompts that the IDE sends to the chat when the action is invoked. Now we’ve opened up this functionality, allowing you to define your own prompts that will be shown in the AI Actions menu.

To save a prompt to a prompt library, you can use one of the following entry points:

  • Click on “Add your prompts” in the AI Actions menu
  • Click on the “Save Current Prompt” button in the AI Assistant tool window
  • Open Settings | Tools | AI Assistant | User Prompts Library
Using the AI Actions menu to add the custom prompt to prompt library

To pass context to a prompt, you can use macros such as $SELECTION and $SELECTION_LANG in the prompt text. Additional ways to specify context will be supported in future updates.

Explain Runtime Error

For Java and Python runtime errors shown in the console, the IDE now shows an inlay hint allowing you to get AI explanations for those errors. Click on “Explain with AI”, and the explanation for the error will be shown in the AI Assistant tool window.

Using Explain with AI option to explain runtime error

Explain RegExp/SQL/Cron

The AI Assistant can now explain regular expressions, SQL queries, Cron expressions and other injected fragments. Put the caret inside the code fragment and invoke the corresponding “Explain…” action from the AI Actions menu, 

AI Assistant explains the selected regular expression

Explain Commit

You can now ask the AI to explain changes committed to a Git or Mercurial repository. Select one or multiple commits in the log window, then select “Explain Commit with AI Assistant” from the context menu, and the AI Assistant tool window will show an explanation of the selected changes.

AI Assistant explains selected changes

General Updates

As was mentioned in the initial announcement, access to AI Assistant is limited during the preview phase. At this time, all the available spots for the use of AI Assistant have been allocated, so new users of the plugin are being added to the waitlist. Unfortunately, we don’t have any specific timeframe for when we’re going to allow everyone to join the service; we’re adding more users gradually, but this depends on the overall system load and our costs. If you’re currently on the waitlist, we’ll send you an email once you’re accepted, so please stay tuned.

We’re also actively working on expanding the set of LLM providers we’re working with, so that we can open up access from more territories. We’ll publish an announcement once we have more information to share.
As usual, your feedback is very much welcome. Please use the “Share your feedback” link in the AI Assistant tool window to let us know what you think about the plugin. If you run into any bugs or have feature suggestions, you’re welcome to file issues in the AI Assistant YouTrack project. Thank you!