void () { targetObjectChooser = new KotlinTypeReferenceEditorComboWithBrowseButton( e -> { TreeClassChooser chooser = createTreeClassChooser(); chooser.selectDirectory(method.getContainingFile().getContainingDirectory()); chooser.showDialog(); PsiClass psiClass = chooser.getSelected(); if (psiClass instanceof KtLightClassForSourceDeclaration) { selectedTarget = ((KtLightClassForSourceDeclaration) psiClass).getKotlinOrigin(); targetObjectChooser.setText(Objects.requireNonNull(psiClass.getQualifiedName())); } }, (targetContainer == null || targetContainer.getFqName() == null) ? null : targetContainer.getFqName().asString(), targetContainer == null ? Objects.requireNonNull(KtPsiUtilKt.getContainingClassOrObject(method)) : targetContainer, RECENTS_KEY ); KtTypeCodeFragment codeFragment = targetObjectChooser.getCodeFragment(); if (codeFragment != null) { CompletionUtilsKt.setExtraCompletionFilter( codeFragment, lookupElement -> { Object lookupObject = lookupElement.getObject(); if (!(lookupObject instanceof DescriptorBasedDeclarationLookupObject)) return false; PsiElement psiElement = ((DescriptorBasedDeclarationLookupObject) lookupObject).getPsiElement(); if (lookupObject instanceof PackageLookupObject) return true; return (psiElement instanceof KtObjectDeclaration) && KotlinCommonRefactoringUtilKt.canRefactorElement(psiElement); } ); } targetObjectChooserPanel.add(targetObjectChooser); }