void (EditorTextField editorTextField, PsiType type) { Editor editor = editorTextField.getEditor(); String prefix = editorTextField.getText(); Set<LookupElement> set = new LinkedHashSet<>(); JavaCompletionUtil.completeVariableNameForRefactoring(editorTextField.getProject(), set, prefix, type, VariableKind.PARAMETER); LookupElement[] lookupItems = set.toArray(LookupElement.EMPTY_ARRAY); editor.getCaretModel().moveToOffset(prefix.length()); editor.getSelectionModel().removeSelection(); LookupManager.getInstance(editorTextField.getProject()).showLookup(editor, lookupItems, prefix); }