Search in sources :

Example 71 with JSONObject

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

the class CodeLensParams method create.

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

Example 72 with JSONObject

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

the class ColorInformation method create.

/**
 * Creates a new ColorInformation literal.
 */
public static ColorInformation create(Range range, Color color) {
    final JSONObject json = new JSONObject();
    json.put("range", range.jsonData);
    json.put("color", color.jsonData);
    return new ColorInformation(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 73 with JSONObject

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

the class ColorPresentationParams method create.

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

Example 74 with JSONObject

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

the class Command method create.

/**
 * Creates a new Command literal.
 */
public static Command create(String title, String command, Object... args) {
    final JSONObject json = new JSONObject();
    json.put("title", title);
    json.put("command", command);
    if (args != null) {
        JSONArray jsonArr = new JSONArray();
        for (Object arg : args) {
            jsonArr.put(arg);
        }
        json.put("arguments", jsonArr);
    }
    return new Command(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)

Example 75 with JSONObject

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

the class CompletionContext method create.

public static CompletionContext create(CompletionTriggerKind triggerKind) {
    final JSONObject json = new JSONObject();
    json.put("triggerKind", triggerKind.getIntValue());
    return new CompletionContext(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