[mod-commands] SetInspectionOptionFix -> UpdateInspectionOptionFix (ModCommand)

GitOrigin-RevId: a1916285a58398848a6ce3c477399b3a86370efc
This commit is contained in:
Tagir Valeev
2023-07-22 17:05:17 +02:00
committed by intellij-monorepo-bot
parent 176f6a543e
commit c0b3b031e7
26 changed files with 162 additions and 104 deletions

View File

@@ -110,14 +110,15 @@ public class ExtractMethodRecommenderInspection extends AbstractBaseJavaLocalIns
List<LocalQuickFix> fixes = new ArrayList<>();
fixes.add(new ExtractMethodFix(from, count, output, inputVariables));
if (inputVariables.size() > 1) {
fixes.add(new SetInspectionOptionFix(ExtractMethodRecommenderInspection.this, "maxParameters",
JavaAnalysisBundle.message("inspection.extract.method.dont.suggest.parameters", inputVariables.size()),
inputVariables.size() - 1));
fixes.add(new UpdateInspectionOptionFix(ExtractMethodRecommenderInspection.this, "maxParameters",
JavaAnalysisBundle.message("inspection.extract.method.dont.suggest.parameters",
inputVariables.size()),
inputVariables.size() - 1).asQuickFix());
}
if (textRange.getLength() < 10_000) {
fixes.add(new SetInspectionOptionFix(ExtractMethodRecommenderInspection.this, "minLength",
JavaAnalysisBundle.message("inspection.extract.method.dont.suggest.length"),
textRange.getLength() + 1));
fixes.add(new UpdateInspectionOptionFix(ExtractMethodRecommenderInspection.this, "minLength",
JavaAnalysisBundle.message("inspection.extract.method.dont.suggest.length"),
textRange.getLength() + 1).asQuickFix());
}
int firstLineBreak = textRange.substring(block.getText()).indexOf('\n');
if (firstLineBreak > -1) {