From 475396995195724a71291f40f14bb9f690b869b6 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Thu, 2 Jan 2014 17:18:42 -0800 Subject: [PATCH] When a file is deleted from the index, the file in the context of which it was parsed should be marked as having unresolved includes. --- .../org/eclipse/cdt/internal/core/pdom/WritablePDOM.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java index d4c703db020..ca2ca475017 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java @@ -25,6 +25,7 @@ import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.index.IIndexFile; import org.eclipse.cdt.core.index.IIndexFileLocation; +import org.eclipse.cdt.core.index.IIndexInclude; import org.eclipse.cdt.core.index.IIndexLocationConverter; import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.parser.ISignificantMacros; @@ -171,6 +172,12 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { IIndexFileLocation location = file.getLocation(); PDOMFile pdomFile = (PDOMFile) file; pdomFile.clear(); + IIndexInclude include = pdomFile.getParsedInContext(); + if (include != null) { + PDOMFile includedBy = (PDOMFile) include.getIncludedBy(); + if (includedBy.getTimestamp() > 0) + getIndexOfFilesWithUnresolvedIncludes().insert(includedBy.getRecord()); + } fEvent.fClearedFiles.add(location); }