mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: add existing template for generic constructors
This commit is contained in:
+1
@@ -184,6 +184,7 @@ class JavaPredefinedConfigurations {
|
||||
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.variables.of.generic.types"),"'_Type <'_GenericArgument+> 'Var = '_Init?;", GENERICS_TYPE),
|
||||
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.diamond.operators"), "new 'Class<>('_Argument*)", GENERICS_TYPE),
|
||||
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.method.returns.bounded.wildcard"), "[script( \"!Method.hasModifierProperty(com.intellij.psi.PsiModifier.ABSTRACT)\" )]'_Type<? extends '_Bound> 'Method('_ParameterType '_Parameter*);", GENERICS_TYPE),
|
||||
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.constructors"), "<'_TypeParameter+> 'Class('_ParameterType '_Parameter*) {\n '_Statement*;\n}", GENERICS_TYPE),
|
||||
|
||||
// Add comments and metadata
|
||||
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.comments"),"/* 'CommentContent */", METADATA_TYPE),
|
||||
|
||||
@@ -103,6 +103,7 @@ predefined.configuration.all.expressions.of.some.type=all expressions of some ty
|
||||
predefined.configuration.variables.of.generic.types=variables of generic types
|
||||
predefined.configuration.diamond.operators=diamond operators
|
||||
predefined.configuration.method.returns.bounded.wildcard=method returns bounded wildcard
|
||||
predefined.configuration.generic.constructors=generic constructors
|
||||
predefined.configuration.comments=comments
|
||||
predefined.configuration.fields_variables.with.given.name.pattern.updated=fields/variables with given name pattern updated
|
||||
predefined.configuration.trys=try's
|
||||
|
||||
+8
@@ -151,6 +151,14 @@ public class JavaPredefinedConfigurationsTest extends StructuralSearchTestCase {
|
||||
asList("List<? extends Number> one() {" +
|
||||
" return null;" +
|
||||
" }")));
|
||||
testCases.put(SSRBundle.message("predefined.configuration.generic.constructors"),
|
||||
pair("class X<U> {" +
|
||||
" X() {}" +
|
||||
" <T> X(String s) {}" +
|
||||
" <T extends U, V> X(int i) {}" +
|
||||
"}",
|
||||
asList("<T> X(String s) {}",
|
||||
"<T extends U, V> X(int i) {}")));
|
||||
}
|
||||
|
||||
public void testPredefinedConfigurations() {
|
||||
|
||||
Reference in New Issue
Block a user