this.currentShellPlugin = global.plugin(aClass);
}
public String completeCode(String script, int caretPos) {
try {
Replacements replacements = currentInterpreter().completeCode(script, caretPos);
StringWriter writer = new StringWriter(1024);
JsonGenerator g = mapper.getMapper().getFactory().createGenerator(writer);
g.writeStartArray();
for (Replacement replacement : replacements.getReplacements()) {
g.writeStartObject();
g.writeStringField("caption", replacement.name);
g.writeStringField("meta", replacement.type);
g.writeStringField("snippet", replacement.snippet);
g.writeEndObject();