Package com.intellij.plugins.haxe.lang.psi

Examples of com.intellij.plugins.haxe.lang.psi.HaxeType


      final Map<String, List<HaxeClassInfo>> result = new THashMap<String, List<HaxeClassInfo>>(classes.size());
      final Map<String, String> qNameCache = new THashMap<String, String>();
      for (AbstractHaxeTypeDefImpl haxeTypeDef : classes) {
        final HaxeClassInfo value = new HaxeClassInfo(haxeTypeDef.getQualifiedName(), HaxeComponentType.typeOf(haxeTypeDef));
        final HaxeTypeOrAnonymous haxeTypeOrAnonymous = haxeTypeDef.getTypeOrAnonymous();
        final HaxeType type = haxeTypeOrAnonymous == null ? null : haxeTypeOrAnonymous.getType();
        final HaxeAnonymousType anonymousType = haxeTypeOrAnonymous == null ? null : haxeTypeOrAnonymous.getAnonymousType();
        if (anonymousType != null) {
          final HaxeTypeExtends typeExtends = anonymousType.getAnonymousTypeBody().getTypeExtends();
          if (typeExtends != null) {
            final String classNameCandidate = typeExtends.getType().getText();
            final String key = classNameCandidate.indexOf('.') != -1 ?
                               classNameCandidate :
                               getQNameAndCache(qNameCache, fileChildren, classNameCandidate);
            put(result, key, value);
          }
        }
        else if (type != null) {
          final String classNameCandidate = type.getText();
          final String qName = classNameCandidate.indexOf('.') != -1 ?
                               classNameCandidate :
                               getQNameAndCache(qNameCache, fileChildren, classNameCandidate);
          put(result, qName, value);
        }
View Full Code Here


  }

  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");
  }
View Full Code Here

TOP

Related Classes of com.intellij.plugins.haxe.lang.psi.HaxeType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.