use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class Diagnostic method getRelatedInformation.
/**
* An array of related diagnostic information, e.g. when symbol-names within a scope collide all
* definitions can be marked via this property.
*/
public List<DiagnosticRelatedInformation> getRelatedInformation() {
final JSONArray json = jsonData.optJSONArray("relatedInformation");
if (json == null) {
return null;
}
final List<DiagnosticRelatedInformation> list = new ArrayList<>(json.length());
for (int i = 0; i < json.length(); i++) {
list.add(new DiagnosticRelatedInformation(json.getJSONObject(i)));
}
return Collections.unmodifiableList(list);
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class DidChangeTextDocumentParams method setContentChanges.
public DidChangeTextDocumentParams setContentChanges(List<TextDocumentContentChangeEvent> contentChanges) {
final JSONArray json = new JSONArray();
for (TextDocumentContentChangeEvent textDocumentContentChangeEvent : contentChanges) {
json.put(textDocumentContentChangeEvent.jsonData);
}
jsonData.put("contentChanges", json);
return this;
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class DidChangeWatchedFilesParams method getChanges.
/**
* The actual file events.
*/
public List<FileEvent> getChanges() {
final JSONArray json = jsonData.getJSONArray("changes");
final List<FileEvent> list = new ArrayList<>(json.length());
for (int i = 0; i < json.length(); i++) {
list.add(new FileEvent(json.getJSONObject(i)));
}
return Collections.unmodifiableList(list);
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class ExecuteCommandOptions method setCommands.
public ExecuteCommandOptions setCommands(List<String> commands) {
final JSONArray json = new JSONArray();
for (String string : commands) {
json.put(string);
}
jsonData.put("commands", json);
return this;
}
use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.
the class ExecuteCommandOptions method getCommands.
/**
* The commands to be executed on the server.
*/
public List<String> getCommands() {
final JSONArray json = jsonData.getJSONArray("commands");
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);
}
Aggregations