mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +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:
parent
7996df4a59
commit
41db303fbf
2 changed files with 16 additions and 1 deletions
|
@ -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 );
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue