use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class CompletionParams method create.
public static CompletionParams create(TextDocumentIdentifier textDocument, Position position) {
final JSONObject json = new JSONObject();
json.put("textDocument", textDocument.jsonData);
json.put("position", position.jsonData);
return new CompletionParams(json);
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class InspectServerSession method createJsonDomain.
private static JSONObject createJsonDomain(String name) {
JSONObject dom = new JSONObject();
dom.put("name", name);
dom.put("version", "1.2");
return dom;
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class InspectServerSession method sendCommandSync.
private void sendCommandSync(Command cmd) {
CommandPostProcessor postProcessor = new CommandPostProcessor();
JSONObject result = processCommand(cmd, postProcessor);
if (result != null) {
JSONMessageListener jsonListener = jsonMessageListener;
if (jsonListener != null) {
try {
jsonListener.onMessage(result);
} catch (UnsupportedTypeException | ArityException | UnsupportedMessageException e) {
context.logException(e);
}
}
}
postProcessor.run();
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class InspectServerSession method getDomains.
private static Params getDomains() {
JSONArray domains = new JSONArray();
domains.put(createJsonDomain("Runtime"));
domains.put(createJsonDomain("Debugger"));
domains.put(createJsonDomain("Profiler"));
domains.put(createJsonDomain("Schema"));
JSONObject domainsObj = new JSONObject();
domainsObj.put("domains", domains);
return new Params(domainsObj);
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class InternalPropertyDescriptor method createJSON.
private static JSONObject createJSON(String name, RemoteObject value) {
JSONObject json = new JSONObject();
json.put("name", name);
if (value != null) {
json.put("value", value.toJSON());
}
return json;
}
Aggregations