Double (@NotNull LookupElement element, @NotNull CompletionLocation location) { final PrioritizedLookupElement<?> prioritized = element.as(PrioritizedLookupElement.CLASS_CONDITION_KEY); if (prioritized != null) { return prioritized.getPriority(); } final LookupItem<?> item = element.as(LookupItem.CLASS_CONDITION_KEY); if (item != null) { return item.getPriority(); } return 0.0; }