void (LookupElement item, Color foreground, @SimpleTextAttributes.StyleAttributeConstant int style, @Nls String name, final SimpleColoredComponent nameComponent, @NotNull List<LookupElementPresentation.DecoratedTextRange> itemNameDecorations) { final SimpleTextAttributes base = new SimpleTextAttributes(style, foreground); final String prefix = item instanceof EmptyLookupItem ? "" : myLookup.itemPattern(item); if (prefix.length() > 0) { Iterable<TextRange> ranges = getMatchingFragments(prefix, name); if (ranges != null) { SimpleTextAttributes highlighted = new SimpleTextAttributes(style, MATCHED_FOREGROUND_COLOR); SpeedSearchUtil.appendColoredFragments(nameComponent, name, ranges, base, highlighted); renderItemNameDecoration(nameComponent, itemNameDecorations, item); return; } } nameComponent.append(name, base); renderItemNameDecoration(nameComponent, itemNameDecorations, item); }