Search in sources :

Example 76 with JSONObject

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);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 77 with JSONObject

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;
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 78 with JSONObject

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();
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject) UnsupportedMessageException(com.oracle.truffle.api.interop.UnsupportedMessageException) UnsupportedTypeException(com.oracle.truffle.api.interop.UnsupportedTypeException) ArityException(com.oracle.truffle.api.interop.ArityException)

Example 79 with JSONObject

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);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject) JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) Params(com.oracle.truffle.tools.chromeinspector.commands.Params)

Example 80 with JSONObject

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;
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Aggregations

JSONObject (com.oracle.truffle.tools.utils.json.JSONObject)318 JSONArray (com.oracle.truffle.tools.utils.json.JSONArray)71 ArrayList (java.util.ArrayList)20 Params (com.oracle.truffle.tools.chromeinspector.commands.Params)18 DebugValue (com.oracle.truffle.api.debug.DebugValue)14 DebugException (com.oracle.truffle.api.debug.DebugException)11 CommandProcessException (com.oracle.truffle.tools.chromeinspector.server.CommandProcessException)10 SourceSection (com.oracle.truffle.api.source.SourceSection)8 HashMap (java.util.HashMap)8 List (java.util.List)8 Collection (java.util.Collection)7 Breakpoint (com.oracle.truffle.api.debug.Breakpoint)6 Source (com.oracle.truffle.api.source.Source)6 Map (java.util.Map)6 LanguageInfo (com.oracle.truffle.api.nodes.LanguageInfo)5 NoSuspendedThreadException (com.oracle.truffle.tools.chromeinspector.InspectorExecutionContext.NoSuspendedThreadException)5 RemoteObject (com.oracle.truffle.tools.chromeinspector.types.RemoteObject)5 JSONTokener (com.oracle.truffle.tools.utils.json.JSONTokener)5 Test (org.junit.Test)5 Location (com.oracle.truffle.tools.chromeinspector.types.Location)4