mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
finishing completion with [ (IDEA-40461)
This commit is contained in:
@@ -210,7 +210,6 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
|
||||
case '<':
|
||||
case '>':
|
||||
case '\"':
|
||||
case '[': return TailType.createSimpleTailType(completionChar);
|
||||
}
|
||||
final TailType attr = item.getTailType();
|
||||
return attr == TailType.UNKNOWN ? TailType.NONE : attr;
|
||||
|
||||
@@ -59,6 +59,7 @@ public class JavaCharFilter extends CharFilter {
|
||||
}
|
||||
}
|
||||
if (c == '.' && isWithinLiteral(lookup)) return Result.ADD_TO_PREFIX;
|
||||
if (c == '[') return CharFilter.Result.SELECT_ITEM_AND_FINISH_LOOKUP;
|
||||
|
||||
if (c == '#' && PsiTreeUtil.getParentOfType(lookup.getPsiElement(), PsiDocComment.class) != null) {
|
||||
final LookupElement item = lookup.getCurrentItem();
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class AbcdClass {}
|
||||
class AbcdeClass {}
|
||||
|
||||
class Foo {
|
||||
Abcd<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class AbcdClass {}
|
||||
class AbcdeClass {}
|
||||
|
||||
class Foo {
|
||||
AbcdClass[<caret>]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
int[] aaaa(int x){}
|
||||
int[] aaab(){}
|
||||
|
||||
|
||||
{
|
||||
aaa<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
int[] aaaa(int x){}
|
||||
int[] aaab(){}
|
||||
|
||||
|
||||
{
|
||||
aaaa()[<caret>]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Foo {
|
||||
d<caret>
|
||||
|
||||
class doz {}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Foo {
|
||||
double[<caret>]
|
||||
|
||||
class doz {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
{
|
||||
int[] aaaa;
|
||||
int[] aaab;
|
||||
aa<caret>
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
{
|
||||
int[] aaaa;
|
||||
int[] aaab;
|
||||
aaaa[<caret>]
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -569,13 +569,7 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
final int parametersCount = ((PsiMethod)getLookup().getCurrentItem().getObject()).getParameterList().getParametersCount();
|
||||
assertEquals(0, parametersCount);
|
||||
new WriteCommandAction.Simple(getProject(), new PsiFile[0]) {
|
||||
@Override
|
||||
protected void run() throws Throwable {
|
||||
getLookup().finishLookup(Lookup.NORMAL_SELECT_CHAR);
|
||||
}
|
||||
}.execute().throwException();
|
||||
|
||||
type '\n'
|
||||
checkResult()
|
||||
}
|
||||
|
||||
@@ -834,6 +828,11 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testCommaAfterVariable() throws Throwable { doTest(',') }
|
||||
|
||||
public void testClassSquareBracket() throws Throwable { doTest('[') }
|
||||
public void testPrimitiveSquareBracket() throws Throwable { doTest('[') }
|
||||
public void testVariableSquareBracket() throws Throwable { doTest('[') }
|
||||
public void testMethodSquareBracket() throws Throwable { doTest('[') }
|
||||
|
||||
public void testSuperProtectedMethod() throws Throwable {
|
||||
myFixture.addClass """package foo;
|
||||
public class Bar {
|
||||
|
||||
Reference in New Issue
Block a user