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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations