follow IDEA-CR-21157

This commit is contained in:
Anna Kozlova
2017-05-18 16:38:55 +03:00
parent 2e3ca462ee
commit cc246d9403
2 changed files with 3 additions and 6 deletions
@@ -249,10 +249,6 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix {
final Editor newEditor = positionCursor(project, targetFile, method);
if (newEditor == null) return;
Template template = builder.buildTemplate();
if (arguments.size() > 20) {
template.setToShortenLongNames(false);
template.setToReformat(false);
}
newEditor.getCaretModel().moveToOffset(rangeMarker.getStartOffset());
newEditor.getDocument().deleteString(rangeMarker.getStartOffset(), rangeMarker.getEndOffset());
rangeMarker.dispose();
@@ -23,11 +23,12 @@ import com.intellij.testFramework.SkipSlowTestLocally;
public class CreateMethodFromUsagePerformanceTest extends LightQuickFixTestCase {
public void testWithHugeNumberOfParameters() {
PlatformTestUtil.startPerformanceTest("100 args for a new method", 200000, () -> {
PlatformTestUtil.startPerformanceTest("5000 args for a new method", 2000000, () -> {
configureFromFileText("Foo.java", "class Foo {{ f<caret>oo(" + StringUtil.repeat("\"a\", ", 5000) + " \"a\");}}");
doAction("Create method 'foo'");
})
.useLegacyScaling()
.cpuBound()
.usesAllCPUCores()
.assertTiming();
}