code-intelligence

Code Intelligence

This Eclipse plugin enhances the Java Development Tools (JDT) with AI code completion and reasoning in a chat view.

Installation

The update site is hosted on https://chabicht.github.io/code-intelligence/update-site/.

In Eclipse, open Help -> Install New Software….
In the dialog, click on Add… and enter the new repository information. For Location, use the URL above.

Screenshot: Add Repository

Make sure the “Contact all update sites” box is checked, some dependencies are hosted in the update site of your Eclipse distribution.

Usage

Completion

The completion feature is integrated in the JDT completion proposal mechanism.
So when you invoke it by e.g. pressing Ctrl + Space, an AI completion is triggered by default.

Screenshot: invocation of the plugin

What also works really well is adding a // TODO comment above where you want an ai completion.

Screenshot: invocation of the plugin with a TODO comment

Chat

You can open a (for now rudimentary) chat view. Go to Window -> Show View -> Other… and select the Code Intelligence Chat view.

Screenshot: Show chat view

Screenshot: Example of the chat view.

Adding context information

If you select text in a Java editor, that selection is added automatically to the context of the next chat message.
Screenshot: Selection as context
Screenshot: Selection as context

You also can right-click on several Java code items such as files, classes, fields, search results, etc.
Screenshot: Adding search results as context

It’s important to be careful with the amount of context you add. Depending on the model used too much information can easily overwhelm the model or become expensive in terms of API fees.

Configuration

Open the preferences: Window -> Preferences -> Code Intelligence.

Screenshot: Plugin configuration page

Here you can add connections to different API providers and configure the model you want to use for code completion and chat requests.

Ollama connection settings

Screenshot: Ollama configuration

OpenAI connection settings

Screenshot: OpenAI configuration

Groq.com connection settings

Screenshot: Groq configuration

Gemini connection settings

Screenshot: Gemini configuration

Anthropic connection settings

Screenshot: Anthropic configuration

X.ai/Grok connection settings

Screenshot: X.ai configuration

DeepSeek connection settings

Screenshot: DeepSeek configuration

Model selection

The model is identified by [Connection Name]/[Model ID], so assuming your OpenAI connection was named OpenAI, to use GPT-4o-Mini, you would enter OpenAI/gpt-4o-mini.

Clicking on Change… opens a dialog where you can select a model from the enabled connections.

Prompt Templates

For an intro to writing custom prompts, see PROMPT-TEMPLATES.md.

Customizing code completion behaviour

By default the an AI request happens when a code completion is triggered.

You can change that behaviour in the settings under Java -> Editor -> Content Assist -> Advanced.

Screenshot: content assist configuration