Esempio n. 1
0
 @Override
 public PsiElement setName(@NotNull String newName) throws IncorrectOperationException {
   final String oldName = FileUtil.getNameWithoutExtension(getName());
   final PsiElement result = super.setName(newName);
   final HaxeClass haxeClass = HaxeResolveUtil.findComponentDeclaration(this, oldName);
   if (haxeClass != null) {
     haxeClass.setName(FileUtil.getNameWithoutExtension(newName));
   }
   return result;
 }
 public void doTest() {
   final PsiFile file =
       PsiDocumentManager.getInstance(myFixture.getProject())
           .getPsiFile(myFixture.getEditor().getDocument());
   assertNotNull(file);
   final HaxeType type =
       PsiTreeUtil.getParentOfType(
           file.findElementAt(myFixture.getCaretOffset()), HaxeType.class, false);
   assertNotNull(type);
   final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(type);
   new HaxeTypeAddImportIntentionAction(
           type,
           HaxeComponentIndex.getItemsByName(
               type.getReferenceExpression().getText(), type.getProject(), scope))
       .execute();
   myFixture.checkResultByFile(getTestName(false) + ".txt");
 }