SSR: simpler predefined template

"classes with parameterless constructors"
This commit is contained in:
Bas Leijdekkers
2018-05-01 22:33:05 +02:00
parent fbe9ffd07b
commit 7220fe80ca
2 changed files with 22 additions and 2 deletions
@@ -158,7 +158,7 @@ class JavaPredefinedConfigurations {
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.class.with.parameterless.constructors"),
"class 'Class {\n '_Method{0,0}:[ script( \"__context__.constructor\" ) ]('_ParameterType '_Parameter+);\n}",
"class 'Class {\n '_Method{0,0}('_ParameterType '_Parameter+);\n}",
CLASS_TYPE
),
@@ -1,4 +1,4 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.structuralsearch;
import com.intellij.openapi.fileTypes.StdFileTypes;
@@ -57,6 +57,26 @@ public class JavaPredefinedConfigurationsTest extends StructuralSearchTestCase {
asList("X() {}",
"X(int i) { System.out.println(i); }",
"X(String... ss) {}")));
testCases.put(SSRBundle.message("predefined.configuration.class.with.parameterless.constructors"),
pair("class X {" +
" X() {}" +
"}" +
"class Y {" +
" Y() {}" +
" Y(String name) {}" +
"}" +
"class Z {" +
" Z(String name) {}" +
"}" +
"class A {" +
" void x(String names) {}" +
"}",
asList("class X {" +
" X() {}" +
"}",
"class A {" +
" void x(String names) {}" +
"}")));
}
public void testPredefinedConfigurations() {