don't fill common prefix for a lookup which couldn't be shown (EA-31744)

This commit is contained in:
peter
2011-11-22 16:24:09 +01:00
parent 3c82a01e33
commit 7d31929fbe
2 changed files with 8 additions and 8 deletions
@@ -474,8 +474,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
if (decision == AutoCompletionDecision.SHOW_LOOKUP) {
CompletionServiceImpl.setCompletionPhase(new CompletionPhase.ItemsCalculated(indicator));
indicator.getLookup().setCalculating(false);
indicator.showLookup();
if (isAutocompleteCommonPrefixOnInvocation() && items.length > 1) {
if (indicator.showLookup() && isAutocompleteCommonPrefixOnInvocation() && items.length > 1) {
indicator.fillInCommonPrefix(false);
}
}
@@ -304,8 +304,8 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
return "Completion" + hashCode();
}
public void showLookup() {
updateLookup();
public boolean showLookup() {
return updateLookup();
}
public CompletionParameters getParameters() {
@@ -320,14 +320,14 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
return myLookup;
}
private void updateLookup() {
private boolean updateLookup() {
ApplicationManager.getApplication().assertIsDispatchThread();
if (isOutdated()) return;
if (isOutdated()) return false;
boolean justShown = false;
if (!myLookup.isShown() && shouldShowLookup()) {
if (hideAutopopupIfMeaningless()) {
return;
return false;
}
if (StringUtil.isEmpty(myLookup.getAdvertisementText()) && !isAutopopupCompletion()) {
@@ -338,7 +338,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
}
if (!myLookup.showLookup()) {
return;
return false;
}
justShown = true;
}
@@ -347,6 +347,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
if (justShown) {
myLookup.ensureSelectionVisible();
}
return true;
}
private boolean shouldShowLookup() {