Search in sources :

Example 11 with JSONArray

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

the class Capabilities method getSupportedChecksumAlgorithms.

/**
 * Checksum algorithms supported by the debug adapter.
 */
public List<String> getSupportedChecksumAlgorithms() {
    final JSONArray json = jsonData.optJSONArray("supportedChecksumAlgorithms");
    if (json == null) {
        return null;
    }
    final List<String> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(json.getString(i));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 12 with JSONArray

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

the class Capabilities method setAdditionalModuleColumns.

public Capabilities setAdditionalModuleColumns(List<ColumnDescriptor> additionalModuleColumns) {
    if (additionalModuleColumns != null) {
        final JSONArray json = new JSONArray();
        for (ColumnDescriptor columnDescriptor : additionalModuleColumns) {
            json.put(columnDescriptor.jsonData);
        }
        jsonData.put("additionalModuleColumns", json);
    }
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Example 13 with JSONArray

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

the class Capabilities method setCompletionTriggerCharacters.

public Capabilities setCompletionTriggerCharacters(List<String> completionTriggerCharacters) {
    if (completionTriggerCharacters != null) {
        final JSONArray json = new JSONArray();
        for (String string : completionTriggerCharacters) {
            json.put(string);
        }
        jsonData.put("completionTriggerCharacters", json);
    }
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Example 14 with JSONArray

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

the class Diagnostic method getTags.

/**
 * Additional metadata about the diagnostic.
 */
public List<DiagnosticTag> getTags() {
    final JSONArray json = jsonData.optJSONArray("tags");
    if (json == null) {
        return null;
    }
    final List<DiagnosticTag> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(DiagnosticTag.get(json.getInt(i)));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 15 with JSONArray

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

the class Diagnostic method setRelatedInformation.

public Diagnostic setRelatedInformation(List<DiagnosticRelatedInformation> relatedInformation) {
    if (relatedInformation != null) {
        final JSONArray json = new JSONArray();
        for (DiagnosticRelatedInformation diagnosticRelatedInformation : relatedInformation) {
            json.put(diagnosticRelatedInformation.jsonData);
        }
        jsonData.put("relatedInformation", json);
    }
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Aggregations

JSONArray (com.oracle.truffle.tools.utils.json.JSONArray)195 JSONObject (com.oracle.truffle.tools.utils.json.JSONObject)85 ArrayList (java.util.ArrayList)74 DebugValue (com.oracle.truffle.api.debug.DebugValue)8 Params (com.oracle.truffle.tools.chromeinspector.commands.Params)8 Collection (java.util.Collection)7 List (java.util.List)7 DebugException (com.oracle.truffle.api.debug.DebugException)6 Source (com.oracle.truffle.api.source.Source)5 SourceSection (com.oracle.truffle.api.source.SourceSection)4 CommandProcessException (com.oracle.truffle.tools.chromeinspector.server.CommandProcessException)4 HashMap (java.util.HashMap)4 Location (com.oracle.truffle.tools.chromeinspector.types.Location)3 Script (com.oracle.truffle.tools.chromeinspector.types.Script)3 CPUSampler (com.oracle.truffle.tools.profiler.CPUSampler)3 CPUSamplerData (com.oracle.truffle.tools.profiler.CPUSamplerData)3 PrintWriter (java.io.PrintWriter)3 Map (java.util.Map)3 TruffleContext (com.oracle.truffle.api.TruffleContext)2 Breakpoint (com.oracle.truffle.api.debug.Breakpoint)2