PrefixMatcher (LookupElement element, WeighingContext context) { PrefixMatcher itemMatcher = context.itemMatcher(element); String pattern = context.itemPattern(element); if (!pattern.equals(itemMatcher.getPrefix())) { return itemMatcher.cloneWithPrefix(pattern); } return itemMatcher; }