Intellij IDEA-Grails GDSL not working

I tried using GDSL scripts for grails project in IDEA.

I tried things as shown in the Guide: GDSL Guide . The steps that I followed were as follows:

  • Created myDef.gdsl file in my project home (i.e. in the folder
    that contaling grails-app, web application etc.)
  • In this file, I added this code:

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

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

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

What am I doing wrong???: (

More details:

  • Idea Series: Ultimate
  • Idea Version: 107.535
+6
source share
1 answer

The GDSL file must be under some source root. The roots of the contents of the Grails module are not the roots of the source. So please consider placing it in src / main / groovy, for example.

+8
source

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


All Articles