AssistAI is an Eclipse IDE plugin that brings ChatGPT functionality into your development environment. This experimental plugin has been primarily tested with Eclipse 2023/03.
- Refactor selected code snippets by asking ChatGPT
- Generate JavaDoc comments for chosen classes or methods with ChatGPT's help
- Create JUnit tests for selected classes or methods using ChatGPT's assistance
- Engage in a conversation with ChatGPT about the content of the currently opened file
- Fix compilation errors with ChatGPT's guidance
- Copy code blocks generated by ChatGPT to the clipboard
- Produce Git commit comments based on changes in staged files
- Customize pre-defined prompts
- Using the OpenAI function call feature AssistAI can use JavaDoc or related source code to better understand the context.
You can also pose general questions to ChatGPT, just like with the regular ChatGPT interface.
The plugin leverages the OpenAI API to send predefined prompts to ChatGPT. These prompts include relevant context from your IDE, such as:
- File name
- Content of the opened file
- Selected class or method name
If you're not satisfied with the results, you can ask follow-up questions to ChatGPT. Your inquiries, along with the complete conversation history, will be sent to ChatGPT, ensuring more precise answers.
Use the "Clear" button to reset the conversation context. Press the "Stop" button to halt ChatGPT's response generation.
- To discuss the class you're working on, select "Discuss" from the "Code Assist AI" context menu and ask any question about the code.
- To refactor a code snippet, select it and choose "Refactor" from the "Code Assist AI" context menu.
- You can also ask ChatGPT to document a selected class or method using the "Document" command:
- Additionally, you can request ChatGPT to generate a JUnit test:
- After staging all modified files, ask ChatGPT to create a Git commit message:
-
If you have errors in your code, ChatGPT can generate a patch to solve your issues. Select "Fix Errors" command, copy patch contents using the "Copy Code" button, and paste it to your project with CTRL+v, or you can use "Apply Patch" button that will open the patch import window.
The "Apply Patch" button is active whenever ChatGPT returns a diff code block. When interacting with ChatGPT (i.e. performing a code review) you can ask it to format its answers this way using a following prompt: "Return your answer in diff format using full paths".
- AssistAI can use function calls to get the related source code or JavaDoc to better understand the problem and provide you with a more accurate solution.
The easiest way to install the plugin is to use the Eclipse Marketplace. Just drag the "Install" button below into your running Eclipse workspace.
Alternatively you can configure an update site:
- In Eclipse IDE, open Help > Install new software
- Click the Add button to open the "add repository" window, and input
AssistAI
as Name andhttps://eclipse-chatgpt-plugin.lm.r.appspot.com/
as Location - Click Add
- Back in Install window, choose AssistAI from the Work with: list
- Select "Assist AI" from the plugin list and proceed to the next step by clicking the Next button
- Accept any certificate warnings (note: this is a self-signed plugin, so you will be warned about potential security risks)
After installing the plugin, configure access to the OpenAI API:
- Open Window > Preferences > Assist AI preferences
- Input your OpenAI API key (you can find your keys at https://platform.openai.com/account/api-keys)
- Input the model name. By default, the plugin uses the gpt-4 model, but you can also utilize gpt-3.5-turbo or any available ChatGPT model. To check which models are available to you, go to https://platform.openai.com/playground?mode=chat and check the Model drop list.
Add the ChatGPT View to your IDE:
- Open Window > Show View > Other
- Select ChatGPT View from the Code Assist AI category