public void test_IntroduceFinalField() throws Exception {
   addNodeById("4038232163187008744");
   addNodeById("4038232163187008759");
   IntroduceFieldRefactoring refactoring = new IntroduceFieldRefactoring();
   refactoring.init(
       SNodeOperations.cast(
           getNodeById("4038232163187008754"),
           SNodeOperations.asSConcept(
               MetaAdapterFactory.getConcept(
                   MetaAdapterFactory.getLanguage(
                       0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"),
                   0xf8cc67c7fbL,
                   "PlusExpression"))),
       null);
   refactoring.setName("i");
   refactoring.setIsFinal(true);
   refactoring.setFieldInitializationPlace(FieldInitializationPlace.FIELD);
   refactoring.setVisibilityLevel(VisibilityLevel.PRIVATE);
   refactoring.doRefactoring();
   {
     List<SNode> nodesBefore =
         ListSequence.fromListAndArray(
             new ArrayList<SNode>(),
             SNodeOperations.cast(
                 getNodeById("4038232163187008745"),
                 SNodeOperations.asSConcept(
                     MetaAdapterFactory.getConcept(
                         MetaAdapterFactory.getLanguage(
                             0xf3061a5392264cc5L,
                             0xa443f952ceaf5816L,
                             "jetbrains.mps.baseLanguage"),
                         0xf8c108ca66L,
                         "ClassConcept"))));
     List<SNode> nodesAfter =
         ListSequence.fromListAndArray(
             new ArrayList<SNode>(),
             SNodeOperations.cast(
                 getNodeById("4038232163187008770"),
                 SNodeOperations.asSConcept(
                     MetaAdapterFactory.getConcept(
                         MetaAdapterFactory.getLanguage(
                             0xf3061a5392264cc5L,
                             0xa443f952ceaf5816L,
                             "jetbrains.mps.baseLanguage"),
                         0xf8c108ca66L,
                         "ClassConcept"))));
     Assert.assertNull(
         "The nodes '" + nodesBefore + "' and '" + nodesAfter + "' do not match!",
         new NodesMatcher().match(nodesBefore, nodesAfter));
   }
 }
 public SAbstractConcept getApplicableConcept2() {
   return MetaAdapterFactory.getConcept(
       MetaAdapterFactory.getLanguage(
           0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"),
       0x101de48bf9eL,
       "ClassifierType");
 }
Beispiel #3
0
 @Override
 protected void fillExtendedLanguages(Collection<SLanguage> extendedLanguages) {
   extendedLanguages.add(
       MetaAdapterFactory.getLanguage(
           SLanguageId.deserialize("9ded098b-ad6a-4657-bfd9-48636cfe8bc3"),
           "jetbrains.mps.lang.traceable"));
 }
Beispiel #4
0
 public SLanguage getLanguage(@NotNull SLanguageId langId, @NotNull String langName) {
   // used languages is a subset of languages detected for meta-registry, don't want to use
   // set of languages available from myInfoCollector, which might not be yet ready, unless we
   // ensure
   // proper read order (first registry, then used languages). It's even more complicated for
   // per-root
   // persistence, where usedLanguages are kept in a header file only, while registry spans few.
   return MetaAdapterFactory.getLanguage(langId, langName);
 }
Beispiel #5
0
 protected void addBuiltInImports() {
   SLanguage base =
       MetaAdapterFactory.getLanguage(
           MetaIdFactory.langId(0xde1ad86d6e504a02L, 0xb306d4d17f64c375L),
           "jetbrains.mps.console.base");
   Collection<SLanguage> baseAndExtensions =
       new SLanguageHierarchy(Collections.singleton(base)).getExtending();
   SModelInternal modelInternal = ((SModelInternal) myModel);
   for (SLanguage l : CollectionSequence.fromCollection(baseAndExtensions)) {
     modelInternal.addLanguage(l);
     Language sourceLangModule = (Language) l.getSourceModule();
     if (sourceLangModule == null) {
       continue;
     }
     modelInternal.addModelImport(
         sourceLangModule.getStructureModelDescriptor().getReference(), false);
     ((AbstractModule) myModel.getModule())
         .addDependency(sourceLangModule.getModuleReference(), false);
   }
   modelInternal.addDevKit(
       PersistenceFacade.getInstance()
           .createModuleReference(
               "fbc25dd2-5da4-483a-8b19-70928e1b62d7(jetbrains.mps.devkit.general-purpose)"));
 }
Beispiel #6
0
 public MigrationScriptReference getDescriptor() {
   return new MigrationScriptReference(
       MetaAdapterFactory.getLanguage(
           0xc7d5b9dda05f4be2L, 0xbc73f2e16994cc67L, "jetbrains.mps.baseLanguage.lightweightdsl"),
       0);
 }
 public MigrationScriptReference getDescriptor() {
   return new MigrationScriptReference(
       MetaAdapterFactory.getLanguage(
           0x18bc659203a64e29L, 0xa83a7ff23bde13baL, "jetbrains.mps.lang.editor"),
       1);
 }