Examples of GlobalSearchScope


Examples of com.intellij.psi.search.GlobalSearchScope

  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

Examples of com.intellij.psi.search.GlobalSearchScope

*/
public class HaxeClassContributor implements ChooseByNameContributor {
  @NotNull
  @Override
  public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) {
    final GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
    final Collection<HaxeComponent> result = HaxeComponentIndex.getItemsByName(name, project, scope);
    return result.toArray(new NavigationItem[result.size()]);
  }
View Full Code Here

Examples of com.intellij.psi.search.GlobalSearchScope

    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

Examples of com.intellij.psi.search.GlobalSearchScope

    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

Examples of com.intellij.psi.search.GlobalSearchScope

      for (final PsiElement element : CollectHighlightsUtil.getElementsInRange(file, startOffset, endOffsets[j])) {
        if (element instanceof HaxeReferenceExpression) {
          HaxeReferenceExpression referenceExpression = (HaxeReferenceExpression)element;

          if (referenceExpression.resolve() == null) {
            final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(referenceExpression);
            final List<HaxeComponent> components =
              HaxeComponentIndex.getItemsByName(referenceExpression.getText(), project, scope);
            if (!components.isEmpty() && components.size() == 1) {
              haxeClassList.add(((HaxeClass)components.get(0)).getQualifiedName());
            }
View Full Code Here

Examples of com.intellij.psi.search.GlobalSearchScope

     *         eg if at least part of the files controlled by the sandbox should be
     *         monitored
     */
    protected boolean doesSandboxIntersectProject(@NotNull final File sandboxFile) {
        final File sandboxFolder = sandboxFile.getParentFile();
        final GlobalSearchScope projectScope = ProjectScope.getProjectScope(project);
        final VirtualFile sandboxVFile = VcsUtil.getVirtualFile(sandboxFile);
        boolean sandboxRelevant = (sandboxVFile != null) && projectScope.contains(sandboxVFile);
        if (!sandboxRelevant) {
            final VirtualFile[] projectContentRoots = ProjectRootManager.getInstance(project).getContentRoots();
            for (int i = 0; i < projectContentRoots.length && !sandboxRelevant; i++) {
                final VirtualFile projectContentRoot = projectContentRoots[i];
                if (VfsUtil.isAncestor(sandboxFolder, VfsUtil.virtualToIoFile(projectContentRoot), true)) {
View Full Code Here

Examples of com.intellij.psi.search.GlobalSearchScope

        Class filenameIndexClass = Class.forName("com.intellij.psi.search.FilenameIndex");
                Method getFilesByName = filenameIndexClass.getMethod("getFilesByName", Project.class,
                        String.class, GlobalSearchScope.class);
        Class projectScopeClass = Class.forName("com.intellij.psi.search.ProjectScope");
                Method getProjectScope = projectScopeClass.getMethod("getProjectScope", Project.class);
                GlobalSearchScope scope = (GlobalSearchScope) getProjectScope.invoke(null, project);
                psiFiles = (PsiFile[]) getFilesByName.invoke(null, project, filePath, scope);
            } else {
        Class psiManagerClass = Class.forName("com.intellij.psi.PsiManager");
                Method getInstance = psiManagerClass.getMethod("getInstance", Project.class);
                Object inst = getInstance.invoke(null, project);
View Full Code Here

Examples of com.intellij.psi.search.GlobalSearchScope

    public static IdeaAnnotation find(
            final Project project, final String line, final JBehaveStepType stepType) {
        if (stepType == null) return null;

        final String annotationName = stepType.qualifiedAnnotationName();
        final GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

        final PsiClass psiAnnotationClass = JavaPsiFacade.getInstance(project).findClass(
                annotationName, globalSearchScope);
        if (psiAnnotationClass == null) return null;
View Full Code Here

Examples of com.intellij.psi.search.GlobalSearchScope

    private WicketSearchScope() {
    }

    @NotNull
    public static GlobalSearchScope resourcesInModuleWithDependenciesAndLibraries(@NotNull Module module) {
        GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, true);
        // add all additional resource paths
        WicketForgeFacet facet = WicketForgeFacet.getInstance(module);
        if (facet != null) {
            for (VirtualFilePointer filePointer : facet.getResourcePaths()) {
                VirtualFile virtualFile = filePointer.getFile();
                if (virtualFile != null) {
                    scope = scope.uniteWith(GlobalSearchScopes.directoryScope(module.getProject(), virtualFile, true));
                }
            }
        }
        return scope;
    }
View Full Code Here

Examples of com.intellij.psi.search.GlobalSearchScope

            return null;
        }

        Project project = psiFile.getProject();

        GlobalSearchScope scope;
        if (WicketPsiUtil.isInLibrary(psiFile)) {
            scope = ProjectScope.getLibrariesScope(project);
        } else {
            Module module = ModuleUtil.findModuleForPsiElement(psiFile);
            if (module == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.