The backend uses a unix socket ($TMP/javacomplete.sock) to communicate with the client.
Currently planned / implemented are the following api calls:
- complete
- cleanimports
- addimport
- definition
A call has to be made in json encoding with the format:
{
"file":"filename",
"expression":"expression",
"prefix":"prefix",
"apicall":"complete",
"line":0,
"buffer":"buffercontent"
}
Contains the current statement without the prefix that will be completed. The statement can be a parameter list, a block statement (for, while, if) or anything that can be parsed using the ExpressionParser class.
Contains the prefix that will be completed. Can be empty.
One of the apicalls enumerated above.
The current line inside the buffer.
The buffer. Currently the buffer needs to be correct syntax. I am planning to replace the parser with the eclipse ASTParser, which will allow to parse incomplete / incorrect syntax.
The backend yields an integer followed by a newline ('\n') seperated list of the following format:
NAME!TYPE!PARAMETER
The number of items are given by the integer in the first line. The parameters are formated in a comma seperated list.