LookupElement (@NotNull LookupElement decorator, @Nullable PsiSwitchBlock switchBlock) { if (switchBlock == null) { return decorator; } PsiCodeBlock body = switchBlock.getBody(); if (body == null) { return decorator; } PsiStatement[] statements = body.getStatements(); if (statements.length == 0) { return decorator; } if (statements[0] instanceof PsiSwitchLabeledRuleStatement) { return PrioritizedLookupElement.withPriority(decorator, 1); } return decorator; }