diff --git a/org.eclipse.jdt.core.tests.javac/projects/multipleOutputDirectories/proj1/.gitignore b/org.eclipse.jdt.core.tests.javac/projects/multipleOutputDirectories/proj1/.gitignore new file mode 100644 index 00000000000..1fcb1529f8e --- /dev/null +++ b/org.eclipse.jdt.core.tests.javac/projects/multipleOutputDirectories/proj1/.gitignore @@ -0,0 +1 @@ +out diff --git a/org.eclipse.jdt.core.tests.javac/projects/multipleOutputDirectories/proj2/.gitignore b/org.eclipse.jdt.core.tests.javac/projects/multipleOutputDirectories/proj2/.gitignore new file mode 100644 index 00000000000..ba077a4031a --- /dev/null +++ b/org.eclipse.jdt.core.tests.javac/projects/multipleOutputDirectories/proj2/.gitignore @@ -0,0 +1 @@ +bin diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionEngine.java index daadebedb6f..c08a8f44aa3 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionEngine.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionEngine.java @@ -341,6 +341,30 @@ public void run() { // } ITypeBinding typeDeclBinding = typeDecl.resolveBinding(); findOverridableMethods(typeDeclBinding, this.modelUnit.getJavaProject(), context); + // TODO: POTENTIAL_METHOD_DECLARATION + + final int typeMatchRule = IJavaSearchConstants.TYPE; + ExtendsOrImplementsInfo extendsOrImplementsInfo = isInExtendsOrImplements(this.toComplete); + if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) { + findTypes(completeAfter, typeMatchRule, null) + // don't care about annotations + .filter(type -> { + try { + return !type.isAnnotation(); + } catch (JavaModelException e) { + return true; + } + }) + .filter(type -> { + return defaultCompletionBindings.stream().map(typeBinding -> typeBinding.getJavaElement()).noneMatch(elt -> type.equals(elt)); + }) + .filter(type -> this.pattern.matchesName(this.prefix.toCharArray(), + type.getElementName().toCharArray())) + .filter(type -> { + return filterBasedOnExtendsOrImplementsInfo(type, extendsOrImplementsInfo); + }) + .map(this::toProposal).forEach(this.requestor::accept); + } suggestDefaultCompletions = false; } if (context.getParent() instanceof MarkerAnnotation) { @@ -1173,7 +1197,8 @@ public void acceptTypeNameMatch(org.eclipse.jdt.core.search.TypeNameMatch match) namePrefix.toCharArray(), SearchPattern.R_PREFIX_MATCH | (this.assistOptions.substringMatch ? SearchPattern.R_SUBSTRING_MATCH : 0) - | (this.assistOptions.subwordMatch ? SearchPattern.R_SUBWORD_MATCH : 0), + | (this.assistOptions.subwordMatch ? SearchPattern.R_SUBWORD_MATCH : 0) + | (this.assistOptions.camelCaseMatch ? SearchPattern.R_CAMELCASE_MATCH : 0), typeMatchRule, searchScope, typeRequestor, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null); // TODO also resolve potential sub-packages } catch (JavaModelException ex) {