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 4c501569de0..d6bd33044e3 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 @@ -1521,7 +1521,7 @@ private CompletionProposal toProposal(IType type) { res.setRelevance(relevance); if (parentType != null) { // propose importing the type - res.setRequiredProposals(new CompletionProposal[] { toImportProposal(simpleName, signature) }); + res.setRequiredProposals(new CompletionProposal[] { toImportProposal(simpleName, signature, type.getPackageFragment()) }); } else { res.setRequiredProposals(new CompletionProposal[0]); } @@ -1701,10 +1701,11 @@ private CompletionProposal toAnonymousConstructorProposal(ITypeBinding typeBindi return res; } - private CompletionProposal toImportProposal(char[] simpleName, char[] signature) { + private CompletionProposal toImportProposal(char[] simpleName, char[] signature, IPackageFragment packageFragment) { InternalCompletionProposal res = new InternalCompletionProposal(CompletionProposal.TYPE_IMPORT, this.offset); res.setName(simpleName); res.setSignature(signature); + res.setPackageName(packageFragment.getElementName().toCharArray()); res.completionEngine = this.nestedEngine; res.nameLookup = this.nameEnvironment.nameLookup; return res;