use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class ResultsPrinter method printRawResults.
void printRawResults() {
JSONArray output = new JSONArray();
for (Results results : resultsList) {
JSONObject jsonResults = new JSONObject();
jsonResults.put("location", results.location);
jsonResults.put("samples", new JSONArray(results.samples));
output.put(jsonResults);
}
stream.print(output);
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class CompletionOptions method getTriggerCharacters.
/**
* Most tools trigger completion request automatically without explicitly requesting it using a
* keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user starts to type an
* identifier. For example if the user types `c` in a JavaScript file code complete will
* automatically pop up present `console` besides others as a completion item. Characters that
* make up identifiers don't need to be listed here.
*
* If code complete should automatically be trigger on characters not being valid inside an
* identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
*/
public List<String> getTriggerCharacters() {
final JSONArray json = jsonData.optJSONArray("triggerCharacters");
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);
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class ConfigurationParams method getItems.
public List<ConfigurationItem> getItems() {
final JSONArray json = jsonData.getJSONArray("items");
final List<ConfigurationItem> list = new ArrayList<>(json.length());
for (int i = 0; i < json.length(); i++) {
list.add(new ConfigurationItem(json.getJSONObject(i)));
}
return Collections.unmodifiableList(list);
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class ConfigurationParams method setItems.
public ConfigurationParams setItems(List<ConfigurationItem> items) {
final JSONArray json = new JSONArray();
for (ConfigurationItem configurationItem : items) {
json.put(configurationItem.jsonData);
}
jsonData.put("items", json);
return this;
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class Coverage method setCovered.
public Coverage setCovered(List<Range> covered) {
final JSONArray json = new JSONArray();
for (Range range : covered) {
json.put(range.jsonData);
}
jsonData.put("covered", json);
return this;
}
Aggregations