Search in sources :

Example 96 with JSONObject

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

the class WorkspaceSymbolParams method create.

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

Example 97 with JSONObject

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

the class SelectionRangeRegistrationOptions method create.

public static SelectionRangeRegistrationOptions 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 SelectionRangeRegistrationOptions(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 98 with JSONObject

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

the class ShowMessageParams method create.

public static ShowMessageParams create(MessageType type, String message) {
    final JSONObject json = new JSONObject();
    json.put("type", type.getIntValue());
    json.put("message", message);
    return new ShowMessageParams(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject)

Example 99 with JSONObject

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

the class SignatureHelp method create.

public static SignatureHelp create(List<SignatureInformation> signatures, Integer activeSignature, Integer activeParameter) {
    final JSONObject json = new JSONObject();
    JSONArray signaturesJsonArr = new JSONArray();
    for (SignatureInformation signatureInformation : signatures) {
        signaturesJsonArr.put(signatureInformation.jsonData);
    }
    json.put("signatures", signaturesJsonArr);
    json.put("activeSignature", activeSignature == null ? JSONObject.NULL : activeSignature);
    json.put("activeParameter", activeParameter == null ? JSONObject.NULL : activeParameter);
    return new SignatureHelp(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject) JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Example 100 with JSONObject

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

the class SignatureHelpContext method create.

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