package jetbrains.mps.kotlin.stubs.common;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import jetbrains.mps.smodel.SModelStereotype;
import org.jetbrains.mps.openapi.model.SModelReference;
import org.jetbrains.mps.openapi.module.SModuleReference;
import org.jetbrains.mps.openapi.persistence.PersistenceFacade;
import org.jetbrains.mps.openapi.model.SModelId;

/**
 * Constants and utilities related to kotlin stub models in MPS
 */
@GeneratedClass(node = "r:3391afe4-c131-4e6c-87cf-990834a43a93(jetbrains.mps.kotlin.stubs.common)/2728382324536352273", model = "r:3391afe4-c131-4e6c-87cf-990834a43a93(jetbrains.mps.kotlin.stubs.common)")
public class KotlinLanguage {
  public enum ModelKind {
    COMMON("kotlin", "kotlin_common"),
    JVM("kotlinJvm", "kotlin_jvm");

    public final String name;
    public final String stereotype;
    public final String rootName;

    ModelKind(String name, String rootName) {
      this.name = name;
      this.stereotype = SModelStereotype.getStubStereotypeForId(name);
      this.rootName = rootName;
    }
  }

  public static SModelReference createSModelReference(String packageName, SModuleReference moduleRef, ModelKind kind) {
    PersistenceFacade facade = PersistenceFacade.getInstance();
    SModelId modelId = facade.createModelId(kind.name + ':' + packageName);
    SModelReference ref = facade.createModelReference(moduleRef, modelId, modelId.getModelName());
    return ref;
  }
}
