@SuppressWarnings("restriction")
public static void printIndexDebugInfo(IProject prj) throws Exception {
System.out.println("========= Index DEBUG INFO ========");
IndexManager im = org.eclipse.dltk.internal.core.ModelManager.getModelManager().getIndexManager();
Index idx = im.getIndex(prj.getFullPath(), true, true); // This is index file for project root
assertNotNull(im.indexLocations.keyTable);
System.out.println("===== Index Locations ====\n" + im.indexLocations + "\n");
im.waitUntilReady();
// And then check using
String[] docNames = idx.queryDocumentNames(null); // To check all documents in this index
assertNotNull(docNames);
System.out.println("===== Index docs ====\n" + StringUtil.collToString(docNames, "\n") );