InsertHandler not working
for (PsiPackage psiPackage: allPackages) {
lookupElements.add(LookupElementBuilder.createWithIcon(psiPackage).withIcon(psiPackage.getIcon(1)).withInsertHandler(new InsertHandler<LookupElement>() {
@Override
public void handleInsert(InsertionContext context, LookupElement item) {
System.out.println("test");
}
}));
}
LookupElement[] lookupArray = new LookupElement[0];
lookupArray = lookupElements.toArray(lookupArray);
LookupManager.getInstance(project).showLookup(editor, lookupArray);
Upon selecting the LookupElements, the handler doesn't fire and nothing shows up in console.
请先登录再写评论。