mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
new HashMap<
This commit is contained in:
@@ -102,6 +102,10 @@ class ConstructorInsertHandler implements InsertHandler<LookupElementDecorator<L
|
||||
LookupItem delegate,
|
||||
final PsiClass psiClass,
|
||||
final boolean forAnonymous) {
|
||||
if (context.getCompletionChar() == '[') {
|
||||
return false;
|
||||
}
|
||||
|
||||
final PsiElement place = context.getFile().findElementAt(context.getStartOffset());
|
||||
final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(context.getProject()).getResolveHelper();
|
||||
assert place != null;
|
||||
@@ -114,7 +118,16 @@ class ConstructorInsertHandler implements InsertHandler<LookupElementDecorator<L
|
||||
}
|
||||
}
|
||||
|
||||
int identifierEnd = context.getTailOffset();
|
||||
|
||||
JavaCompletionUtil.insertParentheses(context, delegate, false, hasParams, forAnonymous);
|
||||
|
||||
if (context.getCompletionChar() == '<') {
|
||||
context.getDocument().insertString(identifierEnd, "<>");
|
||||
context.setAddCompletionChar(false);
|
||||
context.getEditor().getCaretModel().moveToOffset(identifierEnd + 1);
|
||||
}
|
||||
|
||||
return hasParams;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Zooooooo<T> { }
|
||||
class Zooooooz<T> { }
|
||||
|
||||
|
||||
class Bar {
|
||||
{
|
||||
new Zoooo<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Zooooooo<T> { }
|
||||
class Zooooooz<T> { }
|
||||
|
||||
|
||||
class Bar {
|
||||
{
|
||||
new Zooooooo<<caret>>()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Zooooooo<T> { }
|
||||
class Zooooooz<T> { }
|
||||
|
||||
|
||||
class Bar {
|
||||
{
|
||||
new Zoooo<caret>
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Zooooooo<T> { }
|
||||
class Zooooooz<T> { }
|
||||
|
||||
|
||||
class Bar {
|
||||
{
|
||||
new Zooooooo[<caret>]
|
||||
}
|
||||
}
|
||||
+3
@@ -900,6 +900,9 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testStaticInnerExtendingOuter() throws Exception { doTest() }
|
||||
|
||||
public void testNewClassAngleBracket() throws Exception { doTest('<') }
|
||||
public void testNewClassSquareBracket() throws Exception { doTest('[') }
|
||||
|
||||
public void testNoMethodsInParameterType() {
|
||||
configure()
|
||||
assertOrderedEquals myFixture.lookupElementStrings, "final", "float"
|
||||
|
||||
Reference in New Issue
Block a user