AI Assistant in JetBrains IDEs

Read this post in other languages:

Update, Dec 6: JetBrains AI Assistant is generally available with v.2023.3 or JetBrains IDEs and ReSharper. Read more in the dedicated post.

This week’s EAP builds of all IntelliJ-based IDEs and .NET tools include a major new feature: AI Assistant. This blog post focuses on our IntelliJ-based IDEs with a dedicated .NET Tools post coming soon.

Generative AI and large language models are rapidly transforming the landscape of software development tools, and the decision to integrate this technology into our products was a no-brainer for us. Our approach to building the AI Assistant feature focuses on two main aspects:

  • Weaving the AI assistance into the core IDE user workflows.
  • Building a deep integration of AI features with the code understanding, which has always been a strong suit of JetBrains IDEs.

The AI features are powered by the JetBrains AI service. The service transparently connects you, as a product user, to different large language models (LLMs) and enables specific AI-powered features inside many JetBrains products. At launch, the service supports OpenAI and additionally hosts a number of smaller models created by JetBrains. In the future, we plan to extend this to more providers, giving our users access to the best options and models available.

We also plan to support local and on-premises models. For local models, the supported feature set will most likely be limited.

AI features

The current EAP build provides a sample of features that indicates the direction we’re moving in:

AI chat

Use the AI Assistant tool window to have a conversation with the LLM, ask questions, or iterate on a task. The IDE will provide some project-specific context, such as the languages and technologies used in your project. Once you’re happy with the result, use the Insert Snippet at Caret function to put the AI-generated code into the editor, or just copy it over.

To ask the AI about a specific code fragment, select it in the editor and invoke an action from the AI Actions menu (available in the editor context menu or by using the Alt+Enter shortcut). The New chat using selection action allows you to provide your own prompt or request. You can input additional standard AI assistance prompts by selecting Explain code, Suggest refactoring, or Find potential problems, as appropriate.

Documentation generation

If you need to generate the documentation for a declaration using an LLM, call up the AI Actions menu and select Generate documentation action. This is currently supported for Java, Kotlin, and Python.

For Java and Kotlin, documentation generation is suggested when you use the standard method of generating a doc comment stub: type /**. The IDE will generate the statically known part of the comment (such as @param tags in Java), and the AI will generate the actual documentation text for you.

Name suggestions

When you rename a Java, Kotlin, or Python declaration, the AI will suggest name options for the declaration, based on its contents. This can be turned off in Settings | Tools | AI Assistant.

Commit message generation

The commit message dialog now has a Generate Commit Message with AI Assistant button. Click it to send the diffs of your changes to the LLM, which will generate a commit message describing your changes.

AI Assistant functions may differ between products. For more details on specific products check these dedicated posts: CLion, GoLand, IntelliJ IDEA, PhpStorm, PyCharm, ReSharper, Rider, RubyMine, WebStorm, and Fleet.

Access to AI features

To access the AI features, you’ll need to be logged in to the JetBrains AI service with your JetBrains Account. You can log in from the AI Assistant tool window or from Settings | Tools | AI Assistant.

Please note that the JetBrains AI service may not be available for everyone immediately. We will first let a certain number of users in, and once the maximum capacity is reached, the remaining users will be added to a waiting list. We’ll be gradually inviting more people to try the product in the coming weeks.

Access to the AI service is currently restricted to the territories where the OpenAI service is available. You can check the full list of territories here.

The AI service is free to use during the EAP cycle. We’ll be providing the licensing and pricing model at a later date.

How we handle your code and data

When you use AI features, the IDE needs to send your requests and code to the LLM provider. In addition to the prompts you type, the IDE may send additional details, such as pieces of your code, file types, frameworks used, and any other information that may be necessary for providing context to the LLM.

In addition, EAP builds that include the AI assistant functionality perform opt-in collection of detailed data about the usage of AI features, including the full communication between you and the LLM (both text and code fragments). This data is kept strictly confidential and is used by JetBrains for product improvement purposes only. It is never shared with any external parties, and it will not be used for training any ML models that generate code or text, or revealed in any form to any other users.​​ The option controlling detailed data collection can be found under Tools | AI Assistant | Data Sharing | Send AI Assistant usage statistics.

For more detailed information on our data collection policies, please refer to our website.

Sharing feedback

At this stage, it’s extremely important for us to hear your feedback about the new features, including success stories, situations where the AI didn’t do what you expected, and suggestions of other scenarios when AI could assist you. Please send us your ideas and suggestions by clicking Share feedback in the AI Assistant tool window, and report AI Assistant bugs in YouTrack. Thank you!

image description