Powered by
EPAM

AI Assistant for IntelliJ IDEA

RAIL announces the code assistance plugin for IntelliJ IDEA based on OpenAI GPT technology.

Demo video

Introduction

This plugin helps developers to modify projects with the help of ChatGPT in just a click or by writing a simple command in natural language right in the project code.

These are some of the most common tasks you can perform with the plugin:

  • Generate and insert descriptive comments into the project code.
  • Generate and add unit tests into the project.
  • Modify the project by writing free-form requests in natural language right from the project code.

The major benefit of this solution is that ChatGPT generates an output having learned the necessary information about the project. The result is produced in a specific format and according to the precise guidelines which allows to automatically incorporate it into the project. ChatGPT drives the entire process of communication with the server and terminates it when the task is completed.

Example breakdown

This example illustrates that it takes just one click for a user to generate a unit test, while all the communication with ChatGPT and coding is performed behind the scenes. On this diagram, we illustrate the sequence of actions to generate a unit test:

  • Programmer clicks a button Generate unit tests using AI Assistant in the context menu to generate a unit test for the selected class in the project code.
  • IDE sends a command to the plugin to launch the AI Assistant.
  • Plugin sends a command to the server to generate a unit test.
  • The server initiates communication with ChatGPT which does not have any preliminary knowledge about the project. It provides ChatGPT with a predefined precise instruction to complete this specific task and a list of formal commands to investigate the project (text in green color in the console on the demo video).

     

    The server reminds ChatGPT to ask a question after each response it gets from the server. This is done to moderate the communication and prevent ChatGPT from confusing its role in the dialogue.
  • From now on, ChatGPT drives the entire process until the task is completed:
    • ChatGPT uses the provided commands to discover the project (CLASS_DEFINITION, METHOD_REFS, CLASS_REFS and other commands). It stops when it decides that it has enough information to complete the task (text in black color in the console on the demo video).
    • When ready, ChatGPT creates an updated project file (WRTIE command), following the instruction it has received from the server. The result is passed to the server, where it gets parsed and incorporated into the project. Changes are implemented automatically, and a user can validate them prior to uploading to the project code repository.
    • When the task is completed, ChatGPT closes the communication session with the server (STOP command).