use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class Position method create.
/**
* Creates a new Position literal from the given line and character.
*
* @param line The position's line.
* @param character The position's character.
*/
public static Position create(int line, int character) {
final JSONObject json = new JSONObject();
json.put("line", line);
json.put("character", character);
return new Position(json);
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class Range method create.
/**
* Create a new Range liternal.
*
* @param start The range's start position.
* @param end The range's end position.
*/
public static Range create(Position start, Position end) {
final JSONObject json = new JSONObject();
json.put("start", start.jsonData);
json.put("end", end.jsonData);
return new Range(json);
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class ReferenceContext method create.
public static ReferenceContext create(Boolean includeDeclaration) {
final JSONObject json = new JSONObject();
json.put("includeDeclaration", includeDeclaration);
return new ReferenceContext(json);
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class DocumentColorParams method create.
public static DocumentColorParams create(TextDocumentIdentifier textDocument) {
final JSONObject json = new JSONObject();
json.put("textDocument", textDocument.jsonData);
return new DocumentColorParams(json);
}
use of com.oracle.truffle.tools.utils.json.JSONObject in project graal by oracle.
the class DocumentColorRegistrationOptions method create.
public static DocumentColorRegistrationOptions 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 DocumentColorRegistrationOptions(json);
}
Aggregations