mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Fix for 68550: [Indexer] Cannot restart indexer by touching .c/.cpp/.cc files
This commit is contained in:
parent
1f83efa8bd
commit
1075c0ba5f
3 changed files with 14 additions and 6 deletions
|
@ -64,7 +64,7 @@ import org.w3c.dom.Node;
|
||||||
public class IndexManager extends JobManager implements IIndexConstants {
|
public class IndexManager extends JobManager implements IIndexConstants {
|
||||||
/* number of file contents in memory */
|
/* number of file contents in memory */
|
||||||
public static int MAX_FILES_IN_MEMORY = 0;
|
public static int MAX_FILES_IN_MEMORY = 0;
|
||||||
|
|
||||||
public IWorkspace workspace;
|
public IWorkspace workspace;
|
||||||
public SimpleLookupTable indexNames = new SimpleLookupTable();
|
public SimpleLookupTable indexNames = new SimpleLookupTable();
|
||||||
private Map indexes = new HashMap(5);
|
private Map indexes = new HashMap(5);
|
||||||
|
@ -166,9 +166,12 @@ public class IndexManager extends JobManager implements IIndexConstants {
|
||||||
if (indexEnabled){
|
if (indexEnabled){
|
||||||
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
|
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
|
||||||
|
|
||||||
if (!jobSet.add(job.resource.getLocation()))
|
//If we are in WAITING mode, we need to kick ourselves into enablement
|
||||||
|
if (!jobSet.add(job.resource.getLocation()) &&
|
||||||
|
enabledState()==ENABLED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
|
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
|
||||||
// reduces the chance that the file is open later on, preventing it from being deleted
|
// reduces the chance that the file is open later on, preventing it from being deleted
|
||||||
if (!job.initializeContents()) return;
|
if (!job.initializeContents()) return;
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2004-06-25 Bogdan Gheorghe
|
||||||
|
Fix for 68550: [Indexer] Cannot restart indexer by touching .c/.cpp/.cc files
|
||||||
|
|
||||||
|
* search/org/eclipse/cdt/internal/core/search/processing/JobManager.java
|
||||||
|
* index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
|
||||||
|
|
||||||
2004-06-24 Bogdan Gheorghe
|
2004-06-24 Bogdan Gheorghe
|
||||||
Fix for 66695: [Indexer] Manually add an include path to a file/folder
|
Fix for 66695: [Indexer] Manually add an include path to a file/folder
|
||||||
is ignored by indexer
|
is ignored by indexer
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.OperationCanceledException;
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
|
|
||||||
public abstract class JobManager implements Runnable {
|
public abstract class JobManager implements Runnable {
|
||||||
|
|
||||||
/* queue of jobs to execute */
|
/* queue of jobs to execute */
|
||||||
|
@ -175,7 +175,7 @@ public abstract class JobManager implements Runnable {
|
||||||
if( enabled == WAITING ){
|
if( enabled == WAITING ){
|
||||||
//stop waiting, restore the indexing Job for progress
|
//stop waiting, restore the indexing Job for progress
|
||||||
indexJob = new IndexingJob( thread, this );
|
indexJob = new IndexingJob( thread, this );
|
||||||
indexJob.setTicks( jobSet.size() );
|
indexJob.setTicks(awaitingJobsCount());
|
||||||
}
|
}
|
||||||
enabled = ENABLED;
|
enabled = ENABLED;
|
||||||
if (VERBOSE)
|
if (VERBOSE)
|
||||||
|
@ -409,8 +409,7 @@ public abstract class JobManager implements Runnable {
|
||||||
//Put back into enabled state
|
//Put back into enabled state
|
||||||
enable();
|
enable();
|
||||||
}
|
}
|
||||||
|
else if( enabledState() == ENABLED ){
|
||||||
if( enabledState() == ENABLED ){
|
|
||||||
if( indexJob == null ){
|
if( indexJob == null ){
|
||||||
indexJob = new IndexingJob( thread, this );
|
indexJob = new IndexingJob( thread, this );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue