Package com.intellij.psi.search

Examples of com.intellij.psi.search.GlobalSearchScope


  private static PsiClass getPsiClass(PsiElement psiElement, PsiClass wrapperClass,
      PsiType psiFieldType) {
    PsiClassType psiClassType = (PsiClassType) psiFieldType;
    Project project = psiElement.getProject();
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass lazyClass = javaPsiFacade.findClass(CLASS_LAZY, globalSearchScope);
    PsiClass providerClass = javaPsiFacade.findClass(CLASS_PROVIDER, globalSearchScope);

    PsiClassType.ClassResolveResult classResolveResult = psiClassType.resolveGenerics();
View Full Code Here


  @Nullable
  private static String getSecondInvocationTitle(@NotNull FindUsagesOptions options,
      @NotNull FindUsagesHandler handler) {
    if (getShowUsagesShortcut() != null) {
      GlobalSearchScope maximalScope = FindUsagesManager.getMaximalScope(handler);
      if (!notNullizeScope(options, handler.getProject()).equals(maximalScope)) {
        return "Press "
            + KeymapUtil.getShortcutText(getShowUsagesShortcut())
            + " again to search in "
            + maximalScope.getDisplayName();
      }
    }
    return null;
  }
View Full Code Here

        }
    );
  }

  private void findEventsViaMethodsAnnotatedSubscribe() {
    GlobalSearchScope projectScope = ProjectScope.getProjectScope(myProject);
    for (SubscriberMetadata subscriberMetadata : SubscriberMetadata.getAllSubscribers()) {
      performSearch(projectScope, subscriberMetadata.getSubscriberAnnotationClassName());
    }
  }
View Full Code Here

  }

  @Nullable
  public PsiMethod getBusPostMethod(Project project) {
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass busClass = javaPsiFacade.findClass(getBusClassName(), globalSearchScope);
    if (busClass != null) {
      for (PsiMethod psiMethod : busClass.getMethods()) {
        if (psiMethod.getName().equals("post")) {
View Full Code Here

  }

  @Nullable
  private static String getSecondInvocationTitle(@NotNull FindUsagesOptions options, @NotNull FindUsagesHandler handler) {
    if (getShowUsagesShortcut() != null) {
      GlobalSearchScope maximalScope = FindUsagesManager.getMaximalScope(handler);
      if (!notNullizeScope(options, handler.getProject()).equals(maximalScope)) {
        return "Press " + KeymapUtil.getShortcutText(getShowUsagesShortcut()) + " again to search in " + maximalScope.getDisplayName();
      }
    }
    return null;
  }
View Full Code Here

   */
  @Nullable
  public static PsiClass findJavaPsiClass(@NotNull final Project project, @NotNull final String classname) {
    final String fqn = classname.endsWith(".java") ? classname.substring(0, classname.length()-".java".length()) : classname;
    final String dottedName = fqn.contains("/") ? fqn.replace('/', '.') : fqn;
    final GlobalSearchScope scope = GlobalSearchScope.allScope(project);
    return findJavaPsiClass(project, dottedName, scope);
  }
View Full Code Here

  private static void addVariantsFromIndex(final CompletionResultSet resultSet,
                                           final PsiFile targetFile,
                                           @Nullable String prefixPackage,
                                           @Nullable final InsertHandler<LookupElement> insertHandler) {
    final Project project = targetFile.getProject();
    final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(targetFile);
    final MyProcessor processor = new MyProcessor(resultSet, prefixPackage, insertHandler);
    HaxeComponentIndex.processAll(project, processor, scope);

    if (insertHandler != null) {
      targetFile.acceptChildren(new HaxeRecursiveVisitor() {
View Full Code Here

  public static HaxeClass findClassByQName(final @Nullable String qName, final @Nullable PsiElement context) {
    if (context == null || qName == null) {
      return null;
    }
    final PsiManager psiManager = context.getManager();
    final GlobalSearchScope scope = getScopeForElement(context);
    return findClassByQName(qName, psiManager, scope);
  }
View Full Code Here

  private static boolean processInheritors(final String qName, final PsiElement context, final Processor<PsiElement> consumer) {
    final Set<String> namesSet = new THashSet<String>();
    final LinkedList<String> namesQueue = new LinkedList<String>();
    namesQueue.add(qName);
    final Project project = context.getProject();
    final GlobalSearchScope scope = GlobalSearchScope.allScope(project);
    while (!namesQueue.isEmpty()) {
      final String name = namesQueue.pollFirst();
      if (!namesSet.add(name)) {
        continue;
      }
View Full Code Here

      tryCreateAnnotation(expression);
    }
  }

  private void tryCreateAnnotation(HaxeReferenceExpression expression) {
    final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(expression);
    final List<HaxeComponent> components =
      HaxeComponentIndex.getItemsByName(expression.getText(), expression.getProject(), scope);
    if (!components.isEmpty()) {
      myHolder.createErrorAnnotation(expression, HaxeBundle.message("haxe.unresolved.type"))
        .registerFix(new HaxeTypeAddImportIntentionAction(expression, components));
View Full Code Here

TOP

Related Classes of com.intellij.psi.search.GlobalSearchScope

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.