LookupImpl (@NotNull final Editor editor, LookupElement @NotNull [] items, @NotNull final String prefix, @NotNull final LookupArranger arranger) { hideActiveLookup(); final LookupImpl lookup = createLookup(editor, arranger, myProject); ThreadingAssertions.assertEventDispatchThread(); myActiveLookup = lookup; myActiveLookupEditor = editor; Disposer.register(lookup, new Disposable() { @Override public void dispose() { myActiveLookup = null; myActiveLookupEditor = null; fireActiveLookupChanged(lookup, null); } }); if (items.length > 0) { CamelHumpMatcher matcher = new CamelHumpMatcher(prefix); for (LookupElement item : items) { myActiveLookup.addItem(item, matcher); } myActiveLookup.refreshUi(true, true); } fireActiveLookupChanged(null, myActiveLookup); return lookup; }