mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 63320 - Search does not consider working copies
Added a check to turn off indexer timer thread, if number entered is <= 0
This commit is contained in:
parent
ecdcf0a446
commit
22055aad20
4 changed files with 19 additions and 12 deletions
|
@ -119,8 +119,10 @@ public class SourceIndexer extends AbstractIndexer {
|
|||
// start timer
|
||||
String timeOut = CCorePlugin.getDefault().getPluginPreferences().getString(CDT_INDEXER_TIMEOUT);
|
||||
Integer timeOutValue = new Integer(timeOut);
|
||||
requestor.setTimeout(timeOutValue.intValue());
|
||||
requestor.startTimer();
|
||||
if (timeOutValue.intValue() > 0) {
|
||||
requestor.setTimeout(timeOutValue.intValue());
|
||||
requestor.startTimer();
|
||||
}
|
||||
boolean retVal = parser.parse();
|
||||
|
||||
if (!retVal)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2004-05-21 Bogdan Gheorghe
|
||||
bug 63320 - Search does not consider working copies
|
||||
Added a check to turn off indexer timer thread, if number entered is <= 0
|
||||
|
||||
2004-05-18 Andrew Niefer
|
||||
bug 62651 - indexer job hangs if project deleted from workspace
|
||||
When we discard jobs, we must downtick the indexing job as well.
|
||||
|
|
|
@ -18,6 +18,7 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||
|
@ -229,12 +230,15 @@ public class SearchEngine implements ICSearchConstants{
|
|||
IWorkingCopy[] results= new IWorkingCopy[length];
|
||||
int index=0;
|
||||
|
||||
for (int i=0;i<length;i++){
|
||||
IWorkingCopy workingCopy = copies[i];
|
||||
if(scope.encloses(workingCopy.getPath().toOSString())){
|
||||
results[index++]=workingCopy;
|
||||
}
|
||||
}
|
||||
try {
|
||||
for (int i=0;i<length;i++){
|
||||
IWorkingCopy workingCopy = copies[i];
|
||||
if(scope.encloses(workingCopy.getPath().toOSString()) &&
|
||||
workingCopy.hasUnsavedChanges()){
|
||||
results[index++]=workingCopy;
|
||||
}
|
||||
}
|
||||
} catch (CModelException e) {}
|
||||
|
||||
System.arraycopy(results,0,results= new IWorkingCopy[index],0,index);
|
||||
|
||||
|
|
|
@ -343,9 +343,6 @@ public class MatchLocator implements IMatchLocator{
|
|||
|
||||
public void locateMatches( String [] paths, IWorkspace workspace, IWorkingCopy[] workingCopies ) throws InterruptedException{
|
||||
|
||||
if (!(paths.length > 0))
|
||||
return;
|
||||
|
||||
matchStorage = new ArrayList();
|
||||
workspaceRoot = (workspace != null) ? workspace.getRoot() : null;
|
||||
|
||||
|
@ -356,7 +353,7 @@ public class MatchLocator implements IMatchLocator{
|
|||
|
||||
for( int i = 0; i < wcLength; i++ ){
|
||||
IWorkingCopy workingCopy = workingCopies[ i ];
|
||||
String path = workingCopy.getOriginalElement().getPath().toString();
|
||||
String path = workingCopy.getOriginalElement().getPath().toString();
|
||||
wcPaths.put( path, workingCopy );
|
||||
newPaths[ i ] = path;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue