Exemplo n.º 1
0
  @Override
  public IIndexFragmentFile addFile(
      int linkageID, IIndexFileLocation location, ISignificantMacros sigMacros)
      throws CoreException {
    if (uncommittedKey != null
        && uncommittedKey.equals(new FileContentKey(linkageID, location, sigMacros)))
      return uncommittedFile;

    return super.addFile(linkageID, location, sigMacros);
  }
Exemplo n.º 2
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;
 }