Example #1
0
 public Collection<LfGlobalVariable> getAllDeclarations(String name, TwelfFile beforeFile) {
   TwelfFileReference[] memberFiles = getMemberFiles();
   ArrayList<LfGlobalVariable> result = new ArrayList<LfGlobalVariable>();
   for (TwelfFileReference member : memberFiles) {
     TwelfFile file = member.resolve();
     if (file == null) {
       continue;
     }
     if (PsiEquivalenceUtil.areElementsEquivalent(file, beforeFile)) {
       break;
     }
     result.addAll(file.getAllDeclarations(name, Integer.MAX_VALUE));
   }
   return result;
 }
Example #2
0
 public LfGlobalVariable getLastDeclaration(
     String name, TwelfFile beforeFile, @Nullable CodeInsightsHolder callback) {
   TwelfFileReference[] memberFiles = getMemberFiles();
   LfGlobalVariable result = null;
   for (TwelfFileReference member : memberFiles) {
     TwelfFile file = member.resolve();
     if (file == null) {
       continue;
     }
     if (PsiEquivalenceUtil.areElementsEquivalent(file, beforeFile)) {
       break;
     }
     LfGlobalVariable lastDeclaration = file.getLastDeclaration(name, Integer.MAX_VALUE);
     if (lastDeclaration != null) {
       if (result != null && callback != null) {
         callback.hidesOtherDeclaration(lastDeclaration, this);
       }
       result = lastDeclaration;
     }
   }
   return result;
 }