ModCommand (@NotNull ActionContext context) { PsiParameter psiParameter = FieldFromParameterUtils.findParameterAtOffset(context.file(), context.offset()); PsiMethod method = findMethod(psiParameter, context); LOG.assertTrue(method != null); HashSet<String> usedNames = new HashSet<>(); List<PsiParameter> availableParameters = getAvailableParameters(method); return selectParameters(method, availableParameters, parameters -> ModCommand.psiUpdate(context, updater -> { MultiMap<PsiType, PsiParameter> types = new MultiMap<>(); List<PsiParameter> writable = ContainerUtil.map(parameters, updater::getWritable); for (PsiParameter parameter : writable) { types.putValue(parameter.getType(), parameter); } CodeStyleSettings allSettings = CodeStyleSettingsManager.getInstance(context.project()) .cloneSettings(CodeStyle.getSettings(context.file())); JavaCodeStyleSettings settings = allSettings.getCustomSettings(JavaCodeStyleSettings.class); boolean preferLongerNames = settings.PREFER_LONGER_NAMES; for (PsiParameter selected : writable) { settings.PREFER_LONGER_NAMES = preferLongerNames || types.get(selected.getType()).size() > 1; CodeStyle.runWithLocalSettings(context.project(), allSettings, () -> processParameter(context.project(), selected, usedNames)); } })); }