1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 11:25:35 +02:00

bug 48308 - don't block the content assist while waiting for indexing,

force the search to happen on the partial index
This commit is contained in:
Andrew Niefer 2004-06-14 14:39:52 +00:00
parent 7996df4a59
commit 41db303fbf
2 changed files with 16 additions and 1 deletions

View file

@ -53,6 +53,7 @@ public class SearchEngine implements ICSearchConstants{
* compilation units. * compilation units.
*/ */
private IWorkingCopy[] workingCopies = null; private IWorkingCopy[] workingCopies = null;
private int waitingPolicy = ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH;
/** /**
* *
@ -66,6 +67,19 @@ public class SearchEngine implements ICSearchConstants{
this.workingCopies = workingCopies; this.workingCopies = workingCopies;
} }
/**
* Policy is one of ICSearchConstants.FORCE_IMMEDIATE_SEARCH, ICSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH
* or ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH
* @param policy
*/
public void setWaitingPolicy( int policy ){
if( policy == FORCE_IMMEDIATE_SEARCH ||
policy == CANCEL_IF_NOT_READY_TO_SEARCH ||
policy == WAIT_UNTIL_READY_TO_SEARCH )
{
waitingPolicy = policy;
}
}
/** /**
* @return * @return
*/ */
@ -193,7 +207,7 @@ public class SearchEngine implements ICSearchConstants{
pathCollector, pathCollector,
indexManager indexManager
), ),
ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, waitingPolicy,
subMonitor, subMonitor,
null ); null );

View file

@ -133,6 +133,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
resultCollector = new ResultCollector(); resultCollector = new ResultCollector();
completionEngine = new CompletionEngine(resultCollector); completionEngine = new CompletionEngine(resultCollector);
searchEngine = new SearchEngine(); searchEngine = new SearchEngine();
searchEngine.setWaitingPolicy( ICSearchConstants.FORCE_IMMEDIATE_SEARCH );
setupTemplateEngine(); setupTemplateEngine();
fRestrictToMatchingCase = false; fRestrictToMatchingCase = false;