Explain Code with AI Assistant

How AI Assistant can help you understand code

Use ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) on the code you want to use in your question to AI Assistant and select AI Actions. You will be presented with a list of prompts, such as:

  • Explain Code
  • Suggest Refactoring
  • Find Problems
  • New Chat Using Selection
  • Write Documentation
  • Generate Unit Tests
  • Generate Code
  • Convert File to Another Language

These prompts are context aware so may differ depending on your type of project. You can also click on the final link Add Your Prompts to add your own custom prompts with the $SELECTION variable, for example:

  • Code at your caret
  • Project structure
  • Code language
  • VCS history
  • Local changes
  • & More

In addition, AI Assistant is context-aware so when you use one of these prompts, AI Assistant uses information from your project such as: How can I improve the readability of $SELECTION

In this example, we select Explain Code and AI Assistant generates text to help you to understand the code you enquired about.

Related Resources

Full Line Code Completion in JetBrains IDEs, All You Need to Know
What is full line code completion is, how does it work, what languages are supported, and how can you get started
Stop using LLMs for these tasks!
Discover the ins and outs of large language models (LLMs) with Dr. Jodie Burchell.
Generate Unit Tests Using AI Assistant
Can you make your life easier as a developer by using AI to generate unit tests?