Intellij IDEA-Grails GDSL 不工作

发布于 2024-12-20 07:44:06 字数 708 浏览 4 评论 0原文

我尝试在 IDEA 中为我的 grails 项目使用 GDSL 脚本。

我尝试了指南中所示的操作:GDSL 指南 。我遵循的步骤是:

  1. 在我的项目主目录中创建了一个 myDef.gdsl 文件(即在文件夹
    包含 grails-app、web-app 等)
  2. 在该文件中我添加了以下代码:

    def ctx2 = context(ctype: "com.myPackage.MyClass")
    
    贡献者(ctx2){
        方法(名称:“withLock”,类型:“void”,参数:[闭包:{}])
    }
    
  3. 单击“激活”。

但当我这样做时,它仍然没有显示任何自动完成或识别:

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

我做错了什么??? :(

详细信息:

  • 创意系列:终极
  • 创意版本:107.535

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜你已久 2024-12-27 07:44:06

GDSL 文件应位于某个源根目录下。 Grails 模块内容根不是源根。例如,请考虑将其放入 src/main/groovy 中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文