diff --git a/plugins/groovy/resources/standardDsls/GppExtensions.gdsl b/plugins/groovy/resources/standardDsls/GppExtensions.gdsl index 265b872acbb7..4a738abd1616 100644 --- a/plugins/groovy/resources/standardDsls/GppExtensions.gdsl +++ b/plugins/groovy/resources/standardDsls/GppExtensions.gdsl @@ -15,19 +15,10 @@ */ package standardDsls -import com.intellij.util.Function -import org.jetbrains.plugins.groovy.gpp.GppGdkMethod - /** * @author Maxim.Medvedev */ -def gppCategory(def className, def isStatic = false) { - def staticConverter = new Function() {def fun(def m) {new GppGdkMethod(m, true)}}; - def nonStaticConverter = new Function() {def fun(def m) {new GppGdkMethod(m, false)}}; - category className, isStatic ? staticConverter : nonStaticConverter -} - gppCategory "groovy.util.Conversions" gppCategory "groovy.util.Files" gppCategory "groovy.util.Filters" diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/toplevel/GdslMetaClassProperties.groovy b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/toplevel/GdslMetaClassProperties.groovy index 4c4a913054b0..acf3d3bfa2c6 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/toplevel/GdslMetaClassProperties.groovy +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/toplevel/GdslMetaClassProperties.groovy @@ -10,6 +10,7 @@ import org.jetbrains.plugins.groovy.dsl.toplevel.scopes.ScriptScope import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrGdkMethodImpl import com.intellij.psi.PsiMethod import com.intellij.util.Function +import org.jetbrains.plugins.groovy.gpp.GppGdkMethod /** * @author ilyas @@ -60,6 +61,16 @@ class GdslMetaClassProperties { else throw new IllegalArgumentException("Incorrect aruments in method 'category': $params") } + Closure gppCategory = {def className, def isStatic = false -> + def staticConverter = new Function() { + def fun(def m) {new GppGdkMethod(m, true)} + }; + def nonStaticConverter = new Function() { + def fun(def m) {new GppGdkMethod(m, false)} + }; + category className, isStatic ? staticConverter : nonStaticConverter + } + private def processCategoryMethods (def className, Function converter) { contributor(context()) { if (!psiType) return;