package jetbrains.mps.lang.editor.editor;
/*Generated by MPS */
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.baseLanguage.behavior.IMethodLike__BehaviorDescriptor;
import org.jetbrains.mps.openapi.module.SRepository;
import jetbrains.mps.nodeEditor.text.NodeRenderUtil;
public class ConceptFunctionFoldingUtil {
/**
* Returns the string representation of the last statement of the function body, if it is a one-liner.
* Returns null otherwise.
*/
public static String getSimpleString(SNode function) {
if ((function == null)) {
return null;
}
SNode lastStatement = IMethodLike__BehaviorDescriptor.getLastStatement_idi2fhS7A.invoke(function);
if ((lastStatement == null)) {
return null;
}
SRepository repository = lastStatement.getModel().getRepository();
return NodeRenderUtil.renderNodeAsSingleLine(lastStatement, repository);
}
}