From 1a088e0bfcd071e25a23234a03e201bfbf4e1f48 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Tue, 8 Nov 2016 21:01:14 +0300 Subject: [PATCH] [groovy] cleanup --- .../standardDsls/defaultMethods.gdsl | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/plugins/groovy/groovy-psi/resources/standardDsls/defaultMethods.gdsl b/plugins/groovy/groovy-psi/resources/standardDsls/defaultMethods.gdsl index 1dad375ed268..3c021de3192c 100644 --- a/plugins/groovy/groovy-psi/resources/standardDsls/defaultMethods.gdsl +++ b/plugins/groovy/groovy-psi/resources/standardDsls/defaultMethods.gdsl @@ -15,48 +15,7 @@ */ package standardDsls -import com.intellij.psi.PsiType -import com.intellij.psi.util.PsiUtil - -/** - * @author Maxim.Medvedev - */ - -interface Constants { - String STRING = "java.lang.String" - String WILDCARD_PREFIX = "? extends " -} - -private String extractIterableParameter(PsiType type) { - def componentType = PsiUtil.extractIterableTypeParameter(type, true) - return removeWildcard(componentType?.canonicalText ?: componentType?.presentableText); -} - -private String removeWildcard(String componentType) { - componentType = componentType?.replace("?extends", "? extends ") - componentType = componentType?.replace("?super", "? super ") - - if (componentType?.startsWith(Constants.WILDCARD_PREFIX)) { - return componentType?.substring(Constants.WILDCARD_PREFIX.size()) - } - return componentType -} - -private String constructElementTypeArg(PsiType psiType) { - def arg = extractIterableParameter(psiType) - if (!arg || arg == "null") return "" - return "<$arg>" -} - -/* -contributor(ctype: "java.util.Collection") { - method name: "getAt", params: [arg: "int"], type: extractIterableParameter(psiType) - method name: "getAt", params: [arg: "groovy.lang.Range"], type: "java.util.List${constructElementTypeArg(psiType)}" - method name: "getAt", params: [arg: "java.util.Collection"], type: "java.util.List${constructElementTypeArg(psiType)}" -} -*/ - -contributor(ctype:"groovy.lang.GString") { +contributor(ctype: "groovy.lang.GString") { delegatesTo(findClass("java.lang.String")) }