void (@NotNull AnActionEvent e) { String prefix = getEnteredPrefix(); String[] strings = NameUtilCore.splitNameIntoWords(prefix); if (strings.length == 0) return; // "__" has no words String last = strings[strings.length - 1]; int i = prefix.lastIndexOf(last); mySearchPopup.mySearchField.setText(prefix.substring(0, i).trim()); }