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
Local and Fast AI comes to your developer workflow - Full Line Code Completion
Full line code completion is available for Java, Kotlin, Python, JavaScript, TypeScript, CSS, PHP, Go, and Ruby.
Stop using LLMs for these tasks!
Discover the ins and outs of large language models (LLMs) with Dr. Jodie Burchell.