Package com.intellij.psi

Examples of com.intellij.psi.PsiRecursiveElementVisitor


          result.addElement(PrioritizedLookupElement.withPriority(LookupElementBuilder.create(currentSymbol), LOCAL_VARIABLE_PRIORITY));
        }
      }
    } else {
      final Set<String> allSymbols = new HashSet<String>();
      PsiRecursiveElementVisitor visitor = new PsiRecursiveElementVisitor() {
        @Override
        public void visitElement(PsiElement element) {
          if (element instanceof Symbol && !callingSymbolName.equals(((Symbol) element).getSymbolName() + "ZZZ")) {
            allSymbols.add(((Symbol) element).getSymbolName());
          }
          element.acceptChildren(this);
        }
      };
      visitor.visitFile(parameters.getOriginalFile());
      for (String currentSymbol : allSymbols) {
        if (!NAMES.contains(currentSymbol)) {
          result.addElement(PrioritizedLookupElement.withPriority(LookupElementBuilder.create(currentSymbol), GLOBAL_VARIABLE_PRIORITY));
        }
      }
View Full Code Here


      PsiFile psiFile = PsiManager.getInstance(myProject).findFile(virtualFile);
      if (psiFile == null) throw new IllegalStateException("huh? " + virtualFile);
      if (psiFile.getFileType() instanceof JavaFileType) {

        final long startTime = System.currentTimeMillis();
        psiFile.accept(new PsiRecursiveElementVisitor() {
          @Override public void visitElement(PsiElement element) {
            if (element instanceof PsiMethod
                && SubscriberMetadata.isAnnotatedWithSubscriber((PsiMethod) element)) {
              maybeAddSubscriberMethod((PsiMethod) element);
            } else {
View Full Code Here

    final Collection<String> ret = new ArrayList<String>(256);
    final PsiManager psiManager = PsiManager.getInstance(project);
    psiManager.startBatchFilesProcessingMode();
    try {
      //noinspection AnonymousInnerClass
      scope.accept(new PsiRecursiveElementVisitor() {

        FileType fileType;
        String path;
        VirtualFile virtualFile;
View Full Code Here

  public static List<PsiElement> getOccurrences(@NotNull final PsiElement pattern, @Nullable PsiElement context) {
    if (context == null) {
      return Collections.emptyList();
    }
    final List<PsiElement> occurrences = new ArrayList<PsiElement>();
    PsiRecursiveElementVisitor visitor = new PsiRecursiveElementVisitor() {
      public void visitElement(@NotNull PsiElement element) {
        if (PsiEquivalenceUtil.areElementsEquivalent(element, pattern)) {
          occurrences.add(element);
          return;
        }
View Full Code Here

TOP

Related Classes of com.intellij.psi.PsiRecursiveElementVisitor

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.