IntelliJ Idea auto-complete for my own grails meta meta methods?

I use the IntelliJ Idea 10 IDE to develop my Grails, and although it is great for developing β€œstandard” metaclass methods, for example, for domain classes (save, findBy, etc.), it (obviously) cannot collect methods, added by plugins or my own code.

Although I do not expect the IDE to be able to automatically pick them up, I am optimistic about whether there is a way to tell IntelliJ that, for example, "myMethod" is added to all the objects in the domain and that it takes a map and returns "myType".

This is a long shot that I know, but does anyone know how to do this in the config, plugin or some smoke mirrors so that I can: a) stop skipping simple, silly typos and b) get auto-complete?

+4
source share
2 answers

I think you're looking for GroovyDSL scripting infrastructure

http://confluence.jetbrains.net/display/GRVY/Scripting+IDE+for+DSL+awareness

+3
source

it is possible to save the * .gdsl file in src dir with the contents:

contributor(context()) { def scope = com.intellij.psi.search.GlobalSearchScope.allScope(project); delegatesTo(com.intellij.psi.JavaPsiFacade.getInstance(project).findClass('org.grails.datastore.gorm.GormStaticApi', scope)) delegatesTo(com.intellij.psi.JavaPsiFacade.getInstance(project).findClass('org.grails.datastore.gorm.GormEntity', scope))} 
0
source

Source: https://habr.com/ru/post/1337665/


All Articles