IPackageFragment[] packages = javaContext.getProject().getPackageFragments();
Set<String> foundPackages = new HashSet<String>();
for (IPackageFragment currPackage : packages) {
String packageName = currPackage.getElementName();
if (packageName.startsWith(value) && !foundPackages.contains(packageName)) {
proposals.add(new PackageNameCompletionProposal(packageName, annotation, javaContext));
foundPackages.add(packageName);
}
}
return proposals;