void (@NotNull Editor editor, @NotNull PsiParameter parameter, boolean isInteractive) { Project project = parameter.getProject(); PsiType type = getSubstitutedType(parameter); JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(project); String parameterName = parameter.getName(); String propertyName = styleManager.variableNameToPropertyName(parameterName, VariableKind.PARAMETER); PsiMethod method = (PsiMethod)parameter.getDeclarationScope(); PsiClass targetClass = method.getContainingClass(); if (targetClass == null) return; boolean isMethodStatic = method.hasModifierProperty(PsiModifier.STATIC); VariableKind kind = isMethodStatic ? VariableKind.STATIC_FIELD : VariableKind.FIELD; SuggestedNameInfo suggestedNameInfo = styleManager.suggestVariableName(kind, propertyName, null, type); SuggestedNameInfo uniqueNameInfo = styleManager.suggestUniqueVariableName(suggestedNameInfo, targetClass, true); boolean isFinal = !isMethodStatic && method.isConstructor(); PsiVariable variable = IntentionPreviewUtils.writeAndCompute( () -> createField(project, targetClass, method, parameter, type, uniqueNameInfo.names[0], isMethodStatic, isFinal)); if (!isInteractive) return; PsiIdentifier identifier = variable.getNameIdentifier(); if (identifier == null) return; final int textOffset = identifier.getTextOffset(); editor.getCaretModel().moveToOffset(textOffset); new MemberInplaceRenamer(variable, null, editor) { @Override protected boolean shouldSelectAll() { return true; } @Override protected void moveOffsetAfter(boolean success) { super.moveOffsetAfter(success); editor.getCaretModel().moveToOffset(parameter.getTextRange().getEndOffset()); } }.performInplaceRename(); }