1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

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.
This commit is contained in:
Sergey Prigogin 2014-01-02 17:18:42 -08:00
parent c95730601b
commit 4753969951

View file

@ -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);
}