Source:
private boolean completeOnPackageVisibilityStatements(boolean contextAccepted, CompilationUnitDeclaration parsedUnit, PackageVisibilityStatement[] pvsStmts) { for (int i = 0, l = pvsStmts.length; i < l; ++i) { PackageVisibilityStatement pvs = pvsStmts[i]; if (pvs instanceof CompletionOnKeywordModuleInfo) { contextAccepted = true; processModuleKeywordCompletion(parsedUnit, pvs, (CompletionOnKeyword) pvs); return contextAccepted; } if (pvs.pkgRef instanceof CompletionOnPackageVisibilityReference) { contextAccepted = true; buildContext(pvs, null, parsedUnit, null, null); if(!this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) { findPackages((CompletionOnPackageVisibilityReference) pvs.pkgRef); } debugPrintf(); return contextAccepted; } ModuleReference[] targets = pvs.targets; if (targets == null) continue; HashSet<String> skipSet = new HashSet<>(); for (int j = 0, lj = targets.length; j < lj; j++) { ModuleReference target = targets[j]; if (target == null) break; if (target instanceof CompletionOnModuleReference) { buildContext(target, null, parsedUnit, null, null); contextAccepted = true; if(!this.requestor.isIgnored(CompletionProposal.MODULE_REF)) { findTargettedModules((CompletionOnModuleReference) target, skipSet); } debugPrintf(); return contextAccepted; } else if (target instanceof CompletionOnKeyword) { contextAccepted = true; processModuleKeywordCompletion(parsedUnit, target, (CompletionOnKeyword) target); } else { if (target.moduleName != null || target.moduleName == CharOperation.NO_CHAR) { skipSet.add(new String(target.moduleName)); } } } } return contextAccepted; }

Target:
private boolean completeOnPackageVisibilityStatements(boolean contextAccepted, CompilationUnitDeclaration parsedUnit, PackageVisibilityStatement[] pvsStmts) { for (int i = 0, l = pvsStmts.length; i < l; ++i) { PackageVisibilityStatement pvs = pvsStmts[i]; if (pvs instanceof CompletionOnKeywordModuleInfo) { contextAccepted = true; processModuleKeywordCompletion(parsedUnit, pvs, (CompletionOnKeyword) pvs); return contextAccepted; } if (pvs.pkgRef instanceof CompletionOnPackageVisibilityReference) { contextAccepted = true; buildContext(pvs, null, parsedUnit, null, null); if(!this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) { findPackages((CompletionOnPackageVisibilityReference) pvs.pkgRef); } debugPrintf(); return contextAccepted; } ModuleReference[] targets = pvs.targets; if (targets == null) continue; HashSet<String> skipSet = new HashSet<>(); for (int j = 0, lj = targets.length; j < lj; j++) { ModuleReference target = targets[j]; if (target == null) break; if (target instanceof CompletionOnModuleReference) { buildContext(target, null, parsedUnit, null, null); contextAccepted = true; if(!this.requestor.isIgnored(CompletionProposal.MODULE_REF)) { findTargettedModules((CompletionOnModuleReference) target, skipSet); } debugPrintf(); return contextAccepted; } else if (target instanceof CompletionOnKeyword) { contextAccepted = true; processModuleKeywordCompletion(parsedUnit, target, (CompletionOnKeyword) target); } else { if (target.moduleName != null || target.moduleName == CharOperation.NO_CHAR) skipSet.add(new String(target.moduleName)); } } } return contextAccepted; }