Fork of Wojciech Gradkowski's AssistAI for use with Ollama.
- Go to Help -> Eclipse Matketplace.
- Type "Eclipse PDE (Plug-in Development Environment)" in find textbox to search.
- Install "Eclipse PDE (Plug-in Development Environment) latest".
- Go to Help -> Eclipse Matketplace.
- Type "EGit - Git Integration for Eclipse" in find textbox to search.
- Install "EGit - Git Integration for Eclipse X.X.X".
- Go to: File → Import → Git → Projects from Git.
- Select “Clone URI” and click Next.
- Enter https://github.com/jukofyork/aiassistant in the URI field.
- (This should automatically fill the Host field as "github.com" and the Repositry path field as "/jukofyork/aiassistant").
- Leave the Protocol as "https" and the Port blank.
- Enter your GitHub username and a 'Personal Access Token' (NOT your GitHub password, see: https://github.com/settings/tokens).
- Click finish.
- Go to: File → Export → Plug-in Development → Deployable plug-in and fragments.
- Select "eclipse.plugin.aiassistant (X.X.X qualifier)".
- Set the destination as "Install into host repositry:" and leave as default ".../org.eclipse.pde.core/install/" location.
- Click finish and restart the IDE when asked.
Go to Window → Show View → Other... → AI Assistant → AI Assistant and click Open.
You should now see a view that looks like this:
NOTE: If the top part of the view is blank/grey then see below for how to fix this.
Now click the "Settings" button.
If the Ollama API is set up correctly then should see something like this:
Now right click some source code and you should see a context menu like this:
NOTE: The "selection" the context menu uses will be the whole text of the current editor window if nothing is selected.
NOTE: "Fix Warnings" and "Fix Errors" will only appear if you have a file selected with compiler warnings or errors in it.
and you should see something like this when the AI Assistant runs:
You can also paste in code or documentation using the clipboard by right clicking the main view like this:
- Holding the Shift key whilst srolling will scroll through messages.
- Holding the Control key whilst srolling will scroll to the top or bottom.
- Pressing Enter will send the current user messaage to the AI Assistant.
- Pressing Shift+Enter will insert a newline into a message instead of sending it.
- Pressing Control+Enter will add a new user message, but delay sending to the AI Assistant.
- The yellow up/down arrows can be used to retrieve previously sent user messages.
- Copy Code: Copies the code block to the clipbpard.
- Replace Selection: Copies the code block over the top of the curremt editor selection.
- Review Changes: Opens a compare editor that lets you selectively replace the curremt editor selection.
- Apply Patch: Opens the apply patch wizard (NOTE: Only shows if the code block is marked as
diff
language).
NOTE: The "selection" the buttons use will be the whole text of the current editor window if nothing is selected.
NOTE: Make sure to set "Ignore white space" in Compare/Patch settings in Eclipse or (any) compare editor won't work well.
- The templates use the StringTemplate library.
- The following context variables can be used:
<taskname>
,<usertext>
,<filename>
,<language>
,<tag>
,<warnings>
,<errors>
,<document>
,<clipboard>
,<selection>
,<lines>
and<documentation>
(see the sourcecode of the classContext
for what each one does). - The special
<<switch-roles>>
tag can be used for delaying responses, forcing responses, multi-shot learning, etc.
Set environment variables WEBKIT_DISABLE_COMPOSITING_MODE=1
and/or WEBKIT_DISABLE_DMABUF_RENDERER=1
before running Eclipse, eg:
Linux
#!/bin/bash
export WEBKIT_DISABLE_COMPOSITING_MODE=1
export WEBKIT_DISABLE_DMABUF_RENDERER=1
./eclipse
Windows
@ECHO OFF
SET WEBKIT_DISABLE_COMPOSITING_MODE=1
SET WEBKIT_DISABLE_DMABUF_RENDERER=1
start eclipse.exe