コード例 #1
0
  @Override
  public boolean isSubConceptOf(SAbstractConcept concept) {
    if (!(concept instanceof SConceptNodeAdapterBase)) {
      throw new IllegalArgumentException("not supported");
    }

    return SModelUtil.isAssignableConcept(
        myConceptName, ((SConceptNodeAdapterBase) concept).myConceptName);
  }
コード例 #2
0
 public IReferenceInfoResolver getReferenceInfoResolver(SNode referenceNode, SNode targetConcept) {
   if (SModelUtil.isAssignableConcept(
       NameUtil.nodeFQName(targetConcept),
       "jetbrains.mps.baseLanguage.structure.ConstructorDeclaration")) {
     if (SNodeOperations.isInstanceOf(
         referenceNode, "jetbrains.mps.baseLanguage.structure.ClassCreator")) {
       SNode classCreator =
           SNodeOperations.cast(
               referenceNode, "jetbrains.mps.baseLanguage.structure.ClassCreator");
       return new VisibleClassConstructorsScope.ConstructorDeclarationReferenceInfoResolver(
           SLinkOperations.getTargets(classCreator, "actualArgument", true),
           SLinkOperations.getTargets(classCreator, "typeParameter", true),
           getModel(),
           getScope());
     }
   }
   return super.getReferenceInfoResolver(referenceNode, targetConcept);
 }
コード例 #3
0
 @Override
 public IReferenceInfoResolver getReferenceInfoResolver(SNode referenceNode, SNode targetConcept) {
   if (SModelUtil.isAssignableConcept(
       targetConcept,
       SConceptOperations.findConceptDeclaration(
           "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"))) {
     return new IReferenceInfoResolver() {
       @Override
       public SNode resolve(String referenceInfo, SModelReference targetModelReference) {
         if (referenceInfo == null) {
           return null;
         }
         for (SNode node : LocalVariablesScope.this.getNodes(AbstractSearchScope.TRUE_CONDITION)) {
           if (referenceInfo.equals(node.getName())) {
             return node;
           }
         }
         return null;
       }
     };
   }
   return super.getReferenceInfoResolver(referenceNode, targetConcept);
 }