mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't show an autopopup consisting of a single live template item
This commit is contained in:
@@ -634,6 +634,12 @@ public interface Test {
|
||||
assert !lookup
|
||||
}
|
||||
|
||||
public void testNoSingleTemplateLookup() {
|
||||
myFixture.configureByText 'a.java', 'class Foo {{ ite<caret> }}'
|
||||
type 'r'
|
||||
assert !lookup
|
||||
}
|
||||
|
||||
public void testTemplateSelectionByComma() {
|
||||
myFixture.configureByText("a.java", """
|
||||
class Foo {
|
||||
|
||||
+2
-1
@@ -25,6 +25,7 @@ import com.intellij.codeInsight.hint.EditorHintListener;
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
import com.intellij.codeInsight.lookup.*;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
import com.intellij.codeInsight.template.impl.LiveTemplateLookupElement;
|
||||
import com.intellij.featureStatistics.FeatureUsageTracker;
|
||||
import com.intellij.injected.editor.DocumentWindow;
|
||||
import com.intellij.injected.editor.EditorWindow;
|
||||
@@ -511,7 +512,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.isValid()) {
|
||||
if (item.isValid() && !(item instanceof LiveTemplateLookupElement)) {
|
||||
final LookupElementPresentation presentation = new LookupElementPresentation();
|
||||
item.renderElement(presentation);
|
||||
if (StringUtil.isNotEmpty(presentation.getTailText())) {
|
||||
|
||||
Reference in New Issue
Block a user