AI Predictive Coding

Compatible with: IntelliJ IDEA Android Studio
Oct 24, 2016
2 706

Coding is hard, let AI help

Features
  • AI can infer the most relevant method you are calling, and rank it first in autocomplete list
  • Tell AI by writing a line of intention such as /// convert myString to int , Enter, AI will fill in the code snippet for you.
  • ... more to come
Notes

You will also need to the AI.codes dashboard (in fact a local proxy) for this plugin to be functional. The local proxy ensures good user experience by talking to server asynchronously, as retrieving candidates from server usually takes more than 100ms, causing visible delay in UI.

This feature is still in early alpha, and it can break, burn, or make your eyes itchy. Help me improve this plugin by reporting issues

Download plugin

Recent change notes

0.4.2

  • fixed a few bugs in completion

0.4

  • recognize variable names in context
  • a special AI icon for snippets generated by AI

0.3

  • /// intention-based predictive coding
  • Fixed NPE issues in editor
  • Fetch probabilities in async fashion for faster code completion

0.2.1

  • Context-aware token ranking in code completion

0.1

  • Usage frequency-based token ranking in code completion

General usage instructions

Early alpha, so it may break, burn spontaneously, or make your eyes itchy.


Features

1. AI writes code snippets for you so you don't have to go to StackOverflow.


For instance, if you define a String called myFilename and you want to read it to a String list, you can type in what you want, as, /// open myFilename and read each line of it to a String list.
Then, press Enter. At this point, code completion will pop up. AI will parse intention and write the right code snippet for you, as a completion candidate. You can simply press Enter again to insert the snippet. The code snippet written by AI in this example would be



List list = new ArrayList<>();
Scanner scanner = new Scanner(new File(myFilename)).useDelimiter("\\n");
while(scanner.hasNext()) {
list.add(scanner.next());
}


The AI also takes care of auto-imports and uses the right variable name in the snippet.


2. AI ranks tokens in autocompletion for you so you always get what you want without scrolling down the list. We sort methods more naturally based on their semantic similarities to your coding context. For instance, when you are inside a method called deleteElement, and you have a local variable called map which is java.util.Map, the AI understands the semantics of deleteElement and methods in Map, and will rank map.remove higher than map.put, because you are likely to call map.remove in this context.



Install Instructions


1. You will need to install a local Dashboard (a proxy that allows IntelliJ to talk to AI-based API). The Mac OS/Windows versions can be downloaded from Github(Mac OS X or Windows), or you can compile the Dashboard from source following the instructions in the Github Repo (for Linux or if you would like to poke around). Dashboard code is open sourced.


2. If you have not installed this plugin, you can use Menu->Preferences > Plugins > Browse repositories... > Search for "ai" > Install Plugin to install the plugin.


3. Make sure the Dashboard is running, restart your IDE once the plugin is installed. Now you can start writing code.


Privacy Notice

We will NOT upload any of your code to our server.
Method ranking is done by sending the current class name to server, and nothing else. Snippet writing is done by sending whatever you typed in intention line to server as a query, and nothing else.