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

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


  }

  @NotNull
  @Override
  public Collection<PsiElement> findTestsForClass(@NotNull PsiElement element) {
    final HaxeClass haxeClass = findSourceElement(element);
    if (haxeClass == null) {
      return Collections.emptyList();
    }
    final Collection<PsiElement> result = new THashSet<PsiElement>();
    final Pair<String, String> packageAndName = HaxeResolveUtil.splitQName(haxeClass.getQualifiedName());
    final GlobalSearchScope searchScope = GlobalSearchScope.projectScope(element.getProject());
    result.addAll(HaxeComponentIndex.getItemsByName(packageAndName.getSecond() + "Test", element.getProject(), searchScope));
    result.addAll(HaxeComponentIndex.getItemsByName("Test" + packageAndName.getSecond(), element.getProject(), searchScope));
    return result;
  }
View Full Code Here


  }

  @NotNull
  @Override
  public Collection<PsiElement> findClassesForTest(@NotNull PsiElement element) {
    final HaxeClass haxeClass = findSourceElement(element);
    if (haxeClass == null) {
      return Collections.emptyList();
    }
    final Collection<PsiElement> result = new THashSet<PsiElement>();
    final Pair<String, String> packageAndName = HaxeResolveUtil.splitQName(haxeClass.getQualifiedName());
    final GlobalSearchScope searchScope = GlobalSearchScope.projectScope(element.getProject());
    final String className = packageAndName.getSecond();
    if (className.startsWith("Test")) {
      final String name = className.substring("Test".length());
      result.addAll(HaxeComponentIndex.getItemsByName(name, element.getProject(), searchScope));
View Full Code Here

    return result;
  }

  @Override
  public boolean isTest(@NotNull PsiElement element) {
    final HaxeClass haxeClass = findSourceElement(element);
    if (haxeClass == null) {
      return false;
    }
    final String className = haxeClass.getName();
    return className != null && (className.startsWith("Test") || className.endsWith("Test"));
  }
View Full Code Here

    final Set<HaxeComponentName> variables = HaxeMacroUtil.findVariables(at);
    final List<HaxeComponentName> filtered = ContainerUtil.filter(variables, new Condition<HaxeComponentName>() {
      @Override
      public boolean value(HaxeComponentName name) {
        final HaxeClassResolveResult result = HaxeResolveUtil.getHaxeClassResolveResult(name.getParent());
        final HaxeClass haxeClass = result.getHaxeClass();
        return haxeClass != null && "Array".equalsIgnoreCase(haxeClass.getQualifiedName());
      }
    });
    return filtered.isEmpty() ? null : new PsiElementResult(filtered.iterator().next());
  }
View Full Code Here

TOP

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

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.