mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-168214 Unexpected live templates in extends <caret> completion
This commit is contained in:
@@ -129,7 +129,7 @@ public abstract class JavaCodeContextType extends TemplateContextType {
|
||||
if (((PsiJavaCodeReferenceElement)parent).isQualified()) {
|
||||
return false;
|
||||
}
|
||||
if (parent.getParent() instanceof PsiMethodCallExpression) {
|
||||
if (parent.getParent() instanceof PsiMethodCallExpression || parent.getParent() instanceof PsiReferenceList) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -593,12 +593,13 @@ class Outer {
|
||||
|
||||
void testJavaExpressionContext() {
|
||||
final TemplateImpl template = TemplateSettings.getInstance().getTemplate("toar", "other")
|
||||
assertFalse(isApplicable("class Foo {{ if (a <caret>toar) }}", template))
|
||||
assertTrue(isApplicable("class Foo {{ <caret>toar }}", template))
|
||||
assertTrue(isApplicable("class Foo {{ return (<caret>toar) }}", template))
|
||||
assertFalse(isApplicable("class Foo {{ return (aaa <caret>toar) }}", template))
|
||||
assertTrue(isApplicable("class Foo {{ Runnable r = () -> { <caret>System.out.println(\"foo\"); }; ) }}", template))
|
||||
assertTrue(isApplicable("class Foo {{ Runnable r = () -> <caret>System.out.println(\"foo\"); ) }}", template))
|
||||
assert !isApplicable("class Foo {{ if (a <caret>toar) }}", template)
|
||||
assert isApplicable("class Foo {{ <caret>toar }}", template)
|
||||
assert isApplicable("class Foo {{ return (<caret>toar) }}", template)
|
||||
assert !isApplicable("class Foo {{ return (aaa <caret>toar) }}", template)
|
||||
assert isApplicable("class Foo {{ Runnable r = () -> { <caret>System.out.println(\"foo\"); }; ) }}", template)
|
||||
assert isApplicable("class Foo {{ Runnable r = () -> <caret>System.out.println(\"foo\"); ) }}", template)
|
||||
assert !isApplicable("class Foo extends <caret>t {}", template)
|
||||
}
|
||||
|
||||
void testJavaDeclarationContext() {
|
||||
|
||||
Reference in New Issue
Block a user