SuggestedNameInfo (@NotNull Project project, @NotNull PsiCaseLabelElement element, @Nullable PsiType type) { if (element instanceof PsiExpression expression) { return JavaCodeStyleManager.getInstance(project).suggestVariableName(VariableKind.PARAMETER, null, expression, type); } PsiPatternVariable variable = JavaPsiPatternUtil.getPatternVariable(element); List<String> semanticNames = variable != null ? Collections.singletonList(variable.getName()) : Collections.emptyList(); return JavaCodeStyleManager.getInstance(project).suggestNames(semanticNames, VariableKind.PARAMETER, type); }