mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
tweaks to the indexer to fix some files not getting indexed on reopen
and potential to get the indexer disabled.
This commit is contained in:
parent
0c164d2456
commit
c5c4b73fed
5 changed files with 17 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
|||
2004-06-18 Andrew Niefer
|
||||
- DeltaProcessor.updateIndexRemoveResource() : discard if removing a project, discard index jobs for that project.
|
||||
|
||||
2004-06-15 Hoda Amer
|
||||
Fix for PR 63207: ITranslationUnit.getElementAtOffset(i) does not factor in multiple namespace decl
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2004-06-18 Andrew Niefer
|
||||
- call InderManager.jobFinishedNotification( this ) from IndexRequest.cancel() so that the IndexManager's jobSet doesn't
|
||||
become stale.
|
||||
- in JobManager.discardJobs, move getting the old enabledState into the synchronized block so that we can be sure its
|
||||
reset correctly
|
||||
|
||||
2004-06-16 Bogdan Gheorghe
|
||||
- Removed reporting index failed messages from log
|
||||
|
||||
|
|
|
@ -34,13 +34,14 @@ public abstract class IndexRequest implements IJob {
|
|||
}
|
||||
|
||||
public void cancel() {
|
||||
this.manager.jobFinishedNotification( this );
|
||||
this.manager.jobWasCancelled(this.indexPath);
|
||||
this.isCancelled = true;
|
||||
}
|
||||
|
||||
public boolean isReadyToRun() {
|
||||
IProject project = CCorePlugin.getWorkspace().getRoot().getProject(indexPath.segment(0));
|
||||
if ( !this.manager.isIndexEnabled( project ) )
|
||||
if ( !project.isAccessible() || !this.manager.isIndexEnabled( project ) )
|
||||
return false;
|
||||
|
||||
// tag the index as inconsistent
|
||||
|
|
|
@ -584,7 +584,10 @@ public class DeltaProcessor {
|
|||
|
||||
switch (element.getElementType()) {
|
||||
case ICElement.C_PROJECT :
|
||||
indexManager.removeIndexFamily(element.getCProject().getProject().getFullPath());
|
||||
IPath fullPath = element.getCProject().getProject().getFullPath();
|
||||
if( delta.getKind() == IResourceDelta.CHANGED )
|
||||
indexManager.discardJobs(fullPath.segment(0));
|
||||
indexManager.removeIndexFamily(fullPath);
|
||||
// NB: Discarding index jobs belonging to this project was done during PRE_DELETE
|
||||
break;
|
||||
// NB: Update of index if project is opened, closed, or its c nature is added or removed
|
||||
|
|
|
@ -112,12 +112,13 @@ public abstract class JobManager implements Runnable {
|
|||
if (VERBOSE)
|
||||
JobManager.verbose("DISCARD background job family - " + jobFamily); //$NON-NLS-1$
|
||||
|
||||
int oldEnabledState = enabledState();
|
||||
int oldEnabledState = 0;
|
||||
try {
|
||||
IJob currentJob;
|
||||
// cancel current job if it belongs to the given family
|
||||
synchronized(this){
|
||||
currentJob = this.currentJob();
|
||||
oldEnabledState = enabledState();
|
||||
disable();
|
||||
}
|
||||
if (currentJob != null
|
||||
|
|
Loading…
Add table
Reference in a new issue