Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA-Grails GDSL Not Working

I tried to use GDSL Scripts for my grails project in IDEA.

I tried things as shown in the Guide: GDSL Guide. The Steps I followed were:

  1. Created a myDef.gdsl file in my project home(i.e. in the folder
    that containg grails-app, web-app etc)
  2. In that file i added this code:

    def ctx2 = context(ctype: "com.myPackage.MyClass")
    
    contributor(ctx2) {
        method(name: 'withLock', type: 'void', params: [closure: { }])
    }
    
  3. Clicked on Activate.

But it still does not show any autocomplete or recognise when I do:

Myclass m = new MyClass()
m.withLock() //This is not recognised

What am I doing wrong??? :(

Details:

  • Idea Series: Ultimate
  • Idea Version: 107.535
like image 401
Kushal Likhi Avatar asked Dec 08 '11 09:12

Kushal Likhi


1 Answers

The GDSL file should be located under some source root. Grails module content roots aren't source roots. So please consider putting it into src/main/groovy, for example.

like image 164
Peter Gromov Avatar answered Nov 15 '22 09:11

Peter Gromov