more stub+ast diagnostics

This commit is contained in:
peter
2013-06-19 16:36:24 +02:00
parent 08d8406fd2
commit 7350d48cb8
2 changed files with 11 additions and 3 deletions
@@ -94,7 +94,10 @@ public class StubTreeLoaderImpl extends StubTreeLoader {
return null;
}
boolean wasIndexedAlready = FileBasedIndexImpl.isFileIndexed(vFile, StubUpdatingIndex.INDEX_ID);
boolean wasIndexedAlready = ((FileBasedIndexImpl)FileBasedIndex.getInstance()).isFileUpToDate(vFile);
Document document = FileDocumentManager.getInstance().getCachedDocument(vFile);
boolean saved = document == null || FileDocumentManager.getInstance().isDocumentUnsaved(document);
final List<SerializedStubTree> datas = FileBasedIndex.getInstance().getValues(StubUpdatingIndex.INDEX_ID, id, GlobalSearchScope
.fileScope(project, vFile));
@@ -111,6 +114,7 @@ public class StubTreeLoaderImpl extends StubTreeLoader {
ObjectStubTree tree = stub instanceof PsiFileStub ? new StubTree((PsiFileStub)stub) : new ObjectStubTree((ObjectStubBase)stub, true);
tree.setDebugInfo("created from index: " + StubUpdatingIndex.getIndexingStampInfo(vFile) +
", wasIndexedAlready=" + wasIndexedAlready +
", saved=" + saved +
", queried at " + vFile.getTimeStamp());
return tree;
}
@@ -1718,9 +1718,13 @@ public class FileBasedIndexImpl extends FileBasedIndex {
});
}
public boolean isFileUpToDate(VirtualFile file) {
return !myChangedFilesCollector.myFilesToUpdate.contains(file);
}
void processRefreshedFile(@NotNull Project project, @NotNull final com.intellij.ide.caches.FileContent fileContent) {
myChangedFilesCollector.ensureAllInvalidateTasksCompleted();
myChangedFilesCollector.processFileImpl(project, fileContent, false); // ProcessCanceledException will cause readding the file to processing list
myChangedFilesCollector.processFileImpl(project, fileContent, false); // ProcessCanceledException will cause re-adding the file to processing list
}
public void indexFileContent(@Nullable Project project, @NotNull com.intellij.ide.caches.FileContent content) {
@@ -2347,7 +2351,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
(isMock(file) || !isFileIndexed(file, indexId));
}
public static boolean isFileIndexed(VirtualFile file, ID<?, ?> indexId) {
private static boolean isFileIndexed(VirtualFile file, ID<?, ?> indexId) {
ID id = IndexInfrastructure.getStubId(indexId, file.getFileType());
return IndexingStamp.isFileIndexed(file, id, IndexInfrastructure.getIndexCreationStamp(id));
}