|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CodeCompletion
An interface for performing code completion in a given language.
This inspired by the jline's Completor interface but
is defined separately so that we don't introduce a dependency on
jline where it doesn't make sense.
| Method Summary | |
|---|---|
int |
complete(PrintWriter output,
String context,
int cursorPosition,
List candidates)
Generates the completion candidates and fills the supplied list with them. |
void |
setMetadataProvider(MetadataProvider metadataProvider)
Provides the code completion implementation with the metadata provider it can use to format more meaningful completion hints. |
void |
setScriptContext(ScriptContext scriptContext)
The code completor can use the provided script context to find out about possible completions. |
| Method Detail |
|---|
void setScriptContext(ScriptContext scriptContext)
This method is called once before the first complete(PrintWriter, String, int, List) method
is called.
scriptContext - void setMetadataProvider(MetadataProvider metadataProvider)
metadataProvider -
int complete(PrintWriter output,
String context,
int cursorPosition,
List candidates)
output - the output the completor can use to write some additional information to convey some
additional info to the usercontext - the context of the code completion, usually that is the current
statement being edited by the usercursorPosition - the position of the cursor inside the contextcompletions - this should be a list of strings but is intentionally left raw
so that this interface is compatible with jline's Completor.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||