|
96 | 96 | import org.eclipse.jdt.core.dom.IfStatement; |
97 | 97 | import org.eclipse.jdt.core.dom.ImportDeclaration; |
98 | 98 | import org.eclipse.jdt.core.dom.InfixExpression; |
99 | | -import org.eclipse.jdt.core.dom.InfixExpression.Operator; |
100 | 99 | import org.eclipse.jdt.core.dom.Initializer; |
101 | 100 | import org.eclipse.jdt.core.dom.InstanceofExpression; |
102 | 101 | import org.eclipse.jdt.core.dom.Javadoc; |
|
108 | 107 | import org.eclipse.jdt.core.dom.MethodInvocation; |
109 | 108 | import org.eclipse.jdt.core.dom.MethodRef; |
110 | 109 | import org.eclipse.jdt.core.dom.Modifier; |
111 | | -import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword; |
112 | 110 | import org.eclipse.jdt.core.dom.ModuleDeclaration; |
113 | 111 | import org.eclipse.jdt.core.dom.Name; |
114 | 112 | import org.eclipse.jdt.core.dom.NodeFinder; |
|
149 | 147 | import org.eclipse.jdt.core.dom.VariableDeclarationFragment; |
150 | 148 | import org.eclipse.jdt.core.dom.VariableDeclarationStatement; |
151 | 149 | import org.eclipse.jdt.core.dom.WhileStatement; |
| 150 | +import org.eclipse.jdt.core.dom.InfixExpression.Operator; |
| 151 | +import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword; |
152 | 152 | import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; |
153 | 153 | import org.eclipse.jdt.core.search.IJavaSearchConstants; |
154 | 154 | import org.eclipse.jdt.core.search.IJavaSearchScope; |
@@ -586,7 +586,6 @@ public void complete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit sour |
586 | 586 | } |
587 | 587 | } |
588 | 588 |
|
589 | | - |
590 | 589 | try { |
591 | 590 | Bindings defaultCompletionBindings = new Bindings(); |
592 | 591 | Bindings specificCompletionBindings = new Bindings(); |
@@ -1358,30 +1357,30 @@ public void complete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit sour |
1358 | 1357 | if (context instanceof ClassInstanceCreation) { |
1359 | 1358 | if (this.expectedTypes.getExpectedTypes() != null && !this.expectedTypes.getExpectedTypes().isEmpty() && !this.expectedTypes.getExpectedTypes().get(0).isRecovered()) { |
1360 | 1359 | completeConstructor(this.expectedTypes.getExpectedTypes().get(0), context, this.javaProject); |
1361 | | - } else { |
1362 | | - if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF) && !this.requestor.isIgnored(CompletionProposal.CONSTRUCTOR_INVOCATION)) { |
1363 | | - String packageName = "";//$NON-NLS-1$ |
1364 | | - PackageDeclaration packageDecl = this.unit.getPackage(); |
1365 | | - if (packageDecl != null) { |
1366 | | - packageName = packageDecl.getName().toString(); |
1367 | | - } |
1368 | | - this.findTypes(this.prefix, IJavaSearchConstants.TYPE, packageName) |
1369 | | - .filter(type -> { |
1370 | | - try { |
1371 | | - return !type.isAnnotation(); |
1372 | | - } catch (JavaModelException e) { |
1373 | | - return true; |
1374 | | - } |
1375 | | - }) // |
1376 | | - .flatMap(type -> { |
1377 | | - if (this.prefix.isEmpty()) { |
1378 | | - return Stream.of(toProposal(type)); |
1379 | | - } else { |
1380 | | - return toConstructorProposals(type, this.toComplete, false).stream(); |
1381 | | - } |
1382 | | - }) // |
1383 | | - .forEach(this.requestor::accept); |
| 1360 | + } else if (this.toComplete == context) { |
| 1361 | + // completing empty args |
| 1362 | + } else if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF) && !this.requestor.isIgnored(CompletionProposal.CONSTRUCTOR_INVOCATION)) { |
| 1363 | + String packageName = "";//$NON-NLS-1$ |
| 1364 | + PackageDeclaration packageDecl = this.unit.getPackage(); |
| 1365 | + if (packageDecl != null) { |
| 1366 | + packageName = packageDecl.getName().toString(); |
1384 | 1367 | } |
| 1368 | + this.findTypes(this.prefix, IJavaSearchConstants.TYPE, packageName) |
| 1369 | + .filter(type -> { |
| 1370 | + try { |
| 1371 | + return !type.isAnnotation(); |
| 1372 | + } catch (JavaModelException e) { |
| 1373 | + return true; |
| 1374 | + } |
| 1375 | + }) // |
| 1376 | + .flatMap(type -> { |
| 1377 | + if (this.prefix.isEmpty()) { |
| 1378 | + return Stream.of(toProposal(type)); |
| 1379 | + } else { |
| 1380 | + return toConstructorProposals(type, this.toComplete, false).stream(); |
| 1381 | + } |
| 1382 | + }) // |
| 1383 | + .forEach(this.requestor::accept); |
1385 | 1384 | } |
1386 | 1385 | suggestDefaultCompletions = false; |
1387 | 1386 | } |
|
0 commit comments