Non-PSI infrastructure

{{

runner runnerClass:"a.b.C"

          defaultRunnerParams:["a","b",...] {

  location type: File,Class

              nameFiler: e -> ...

}

debugger {
}
}}

PSI


enhance "java.lang.String" {
  mix "foo.StringUtils"
}

enhance "groovy.lang.Script" { Map args ->
  if (file.extension == 'gant') {
    property "ant", "org.codehaus.gant.GantBuilder"
    //...
    method name:"depends", type:"void", params:[list:"List"]
  }
}

enhance { Map args ->
  if (clazz.hasAnnotation("foo.Precious")) {
    mix "foo.MyPreciousClass"
  }
}

enhance { 
  if (isDomain(clazz)) {
    if (referenceName) {
      (name, params) = resolveDynamicFinder(referenceName)
      method name:it, type:clazz.qualifiedName, params:params
    } else {
      if (completionPrefix) {
        generateNextFinderNames(completionPrefix).each { name, params ->
          method name:name, type:clazz.qualifiedName, partial:true, params:params
        }
      }
    }
  }
}

enhance "groovy.lang.Script" { 
  if (file.extension == 'gdsl') {
    method name:"enhance", type:"void", params:[className:"String", enhancer:{
      property "clazz", "ClassWrapper"
      method name:"method", type:"void", params:[name:"String", type:"String", partial:"boolean", params:"Map"]
    }]
  }
}

class DGM {
  each(List, Closure c)
}