Пример #1
0
 public PDOMFile getFileForASTNode(int linkageID, IASTNode node) throws CoreException {
   if (fPathResolver != null && node != null) {
     IASTFileLocation loc = node.getFileLocation();
     if (loc != null) {
       IASTPreprocessorIncludeStatement owner = loc.getContextInclusionStatement();
       ISignificantMacros sigMacros =
           owner != null ? owner.getSignificantMacros() : ISignificantMacros.NONE;
       if (sigMacros != null) {
         IIndexFileLocation location = fPathResolver.resolveASTPath(loc.getFileName());
         if (uncommittedKey != null
             && uncommittedKey.equals(new FileContentKey(linkageID, location, sigMacros)))
           return fileBeingUpdated != null ? fileBeingUpdated : uncommittedFile;
         return getBestFile(
             linkageID, location, node.getTranslationUnit().getOriginatingTranslationUnit());
       }
     }
   }
   return null;
 }