Result (char c, final int prefixLength, final Lookup lookup) { if (Character.isJavaIdentifierPart(c)) return Result.ADD_TO_PREFIX; return switch (c) { case '.', ',', ';', '=', ' ', ':', '(' -> Result.SELECT_ITEM_AND_FINISH_LOOKUP; case '-' -> ContainerUtil.exists(lookup.getItems(), item -> matchesAfterAppendingChar(lookup, item, c)) ? Result.ADD_TO_PREFIX : Result.HIDE_LOOKUP; default -> Result.HIDE_LOOKUP; }; }