void (@NotNull Editor editor, @NotNull LightweightHint hint, int flags, @NotNull HintHint hintInfo) { if (editor.getProject() == myProject) { Lookup lookup = getActiveLookup(); if (lookup != null && BitUtil.isSet(flags, HintManager.HIDE_BY_LOOKUP_ITEM_CHANGE)) { lookup.addLookupListener(new LookupListener() { @Override public void currentItemChanged(@NotNull LookupEvent event) { hint.hide(); } @Override public void itemSelected(@NotNull LookupEvent event) { hint.hide(); } @Override public void lookupCanceled(@NotNull LookupEvent event) { hint.hide(); } }); } } }