mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gdsl exceptions fix
This commit is contained in:
@@ -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"
|
||||
|
||||
+11
@@ -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<PsiMethod, PsiMethod> converter) {
|
||||
contributor(context()) {
|
||||
if (!psiType) return;
|
||||
|
||||
Reference in New Issue
Block a user