Search in sources :

Example 46 with JSONObject

use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.

the class Position method create.

/**
 * Creates a new Position literal from the given line and character.
 *
 * @param line The position's line.
 * @param character The position's character.
 */
public static Position create(int line, int character) {
    final JSONObject json = new JSONObject();
    json.put("line", line);
    json.put("character", character);
    return new Position(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 47 with JSONObject

use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.

the class Range method create.

/**
 * Create a new Range liternal.
 *
 * @param start The range's start position.
 * @param end The range's end position.
 */
public static Range create(Position start, Position end) {
    final JSONObject json = new JSONObject();
    json.put("start", start.jsonData);
    json.put("end", end.jsonData);
    return new Range(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 48 with JSONObject

use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.

the class ReferenceContext method create.

public static ReferenceContext create(Boolean includeDeclaration) {
    final JSONObject json = new JSONObject();
    json.put("includeDeclaration", includeDeclaration);
    return new ReferenceContext(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 49 with JSONObject

use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.

the class DocumentColorParams method create.

public static DocumentColorParams create(TextDocumentIdentifier textDocument) {
    final JSONObject json = new JSONObject();
    json.put("textDocument", textDocument.jsonData);
    return new DocumentColorParams(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 50 with JSONObject

use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.

the class DocumentColorRegistrationOptions method create.

public static DocumentColorRegistrationOptions create(List<Object> documentSelector) {
    final JSONObject json = new JSONObject();
    if (documentSelector != null) {
        JSONArray documentSelectorJsonArr = new JSONArray();
        for (Object object : documentSelector) {
            if (object instanceof DocumentFilter) {
                documentSelectorJsonArr.put(((DocumentFilter) object).jsonData);
            } else {
                documentSelectorJsonArr.put(object);
            }
        }
        json.put("documentSelector", documentSelectorJsonArr);
    } else {
        json.put("documentSelector", JSONObject.NULL);
    }
    return new DocumentColorRegistrationOptions(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject) JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) 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