mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't fill common prefix for a lookup which couldn't be shown (EA-31744)
This commit is contained in:
+1
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user