mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make complete-statement-completion smart-wrap constructor arguments (IDEADEV-41023)
This commit is contained in:
@@ -93,8 +93,10 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
|
||||
myDocument = myEditor.getDocument();
|
||||
|
||||
TailType tailType = getTailType(completionChar);
|
||||
if (completionChar == Lookup.COMPLETE_STATEMENT_SELECT_CHAR) {
|
||||
tailType = TailType.SMART_COMPLETION;
|
||||
}
|
||||
|
||||
//adjustContextAfterLookupStringInsertion();
|
||||
myState = new InsertHandlerState(myContext.getSelectionEndOffset(), myContext.getSelectionEndOffset());
|
||||
|
||||
final boolean needLeftParenth = isToInsertParenth();
|
||||
@@ -412,7 +414,6 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
|
||||
case '#':
|
||||
case '\"':
|
||||
case '[': return TailType.createSimpleTailType(completionChar);
|
||||
case Lookup.COMPLETE_STATEMENT_SELECT_CHAR: return TailType.SMART_COMPLETION;
|
||||
//case '!': if (!(myLookupItem.getObject() instanceof PsiVariable)) return TailType.EXCLAMATION;
|
||||
}
|
||||
final TailType attr = myLookupItem.getTailType();
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MyJavaClass {
|
||||
|
||||
{
|
||||
|
||||
List l = new ArrayList(239);
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import java.util.List;
|
||||
|
||||
public class MyJavaClass {
|
||||
|
||||
{
|
||||
|
||||
List l = new ArraL<caret>239
|
||||
}
|
||||
}
|
||||
+6
@@ -862,6 +862,12 @@ public class SmartTypeCompletionTest extends LightCompletionTestCase {
|
||||
checkResultByTestName();
|
||||
}
|
||||
|
||||
public void testConstructorArgsSmartEnter() throws Exception {
|
||||
configureByTestName();
|
||||
select(Lookup.COMPLETE_STATEMENT_SELECT_CHAR);
|
||||
checkResultByTestName();
|
||||
}
|
||||
|
||||
private void configureByTestName() throws Exception {
|
||||
configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user