1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Improved progress reporting when refreshing the content of the index.

This commit is contained in:
Markus Schorn 2007-12-07 16:44:20 +00:00
parent 866014dbc8
commit 8d6553b223

View file

@ -80,6 +80,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
private static class FileInfo { private static class FileInfo {
IIndexFile fIndexFile= null; IIndexFile fIndexFile= null;
boolean fRequestUpdate= false; boolean fRequestUpdate= false;
boolean fRequestIsCounted= true;
boolean fIsUpdated= false; boolean fIsUpdated= false;
public IMacro[] fMacros; public IMacro[] fMacros;
} }
@ -476,6 +477,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
final IIndexFileLocation ifl = fResolver.resolveFile(tu); final IIndexFileLocation ifl = fResolver.resolveFile(tu);
final FileInfo info= getFileInfo(linkageID, ifl); final FileInfo info= getFileInfo(linkageID, ifl);
if (info != null && info.fRequestUpdate && !info.fIsUpdated) { if (info != null && info.fRequestUpdate && !info.fIsUpdated) {
info.fRequestIsCounted= false;
final IScannerInfo scannerInfo= fResolver.getBuildConfiguration(linkageID, tu); final IScannerInfo scannerInfo= fResolver.getBuildConfiguration(linkageID, tu);
parseFile(tu, linkageID, ifl, scannerInfo, monitor); parseFile(tu, linkageID, ifl, scannerInfo, monitor);
if (info.fIsUpdated) { if (info.fIsUpdated) {
@ -501,6 +503,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
Object tu= findContext((IIndexFragmentFile) info.fIndexFile, contextMap); Object tu= findContext((IIndexFragmentFile) info.fIndexFile, contextMap);
if (tu != null) { if (tu != null) {
final IScannerInfo scannerInfo= fResolver.getBuildConfiguration(linkageID, tu); final IScannerInfo scannerInfo= fResolver.getBuildConfiguration(linkageID, tu);
info.fRequestIsCounted= false;
parseFile(tu, linkageID, fResolver.resolveFile(tu), scannerInfo, monitor); parseFile(tu, linkageID, fResolver.resolveFile(tu), scannerInfo, monitor);
if (info.fIsUpdated) { if (info.fIsUpdated) {
updateInfo(0, 1, 0); // a header was parsed in context updateInfo(0, 1, 0); // a header was parsed in context
@ -524,6 +527,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
final IIndexFileLocation ifl = fResolver.resolveFile(header); final IIndexFileLocation ifl = fResolver.resolveFile(header);
final FileInfo info= getFileInfo(linkageID, ifl); final FileInfo info= getFileInfo(linkageID, ifl);
if (info != null && info.fRequestUpdate && !info.fIsUpdated) { if (info != null && info.fRequestUpdate && !info.fIsUpdated) {
info.fRequestIsCounted= false;
final IScannerInfo scannerInfo= fResolver.getBuildConfiguration(linkageID, header); final IScannerInfo scannerInfo= fResolver.getBuildConfiguration(linkageID, header);
parseFile(header, linkageID, ifl, scannerInfo, monitor); parseFile(header, linkageID, ifl, scannerInfo, monitor);
if (info.fIsUpdated) { if (info.fIsUpdated) {
@ -665,13 +669,16 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
} }
info= createFileInfo(new FileKey(linkageID, ifl.getURI()), ifile); info= createFileInfo(new FileKey(linkageID, ifl.getURI()), ifile);
if (ifile == null) { if (ifile == null) {
if (info.fRequestUpdate && !info.fIsUpdated) { info.fRequestIsCounted= false;
updateInfo(0,0,-1); // header found implicitly
}
info.fRequestUpdate= true; info.fRequestUpdate= true;
} }
} }
return !info.fIsUpdated && info.fRequestUpdate; final boolean needUpdate= !info.fIsUpdated && info.fRequestUpdate;
if (needUpdate && info.fRequestIsCounted) {
updateInfo(0, 0, -1);
info.fRequestIsCounted= false;
}
return needUpdate;
} }
private IPath getPathForLabel(IIndexFileLocation ifl) { private IPath getPathForLabel(IIndexFileLocation ifl) {