gpt4 book ai didi

grails - Intellij IDEA-Grails GDSL 不工作

转载 作者:行者123 更新时间:2023-12-04 14:33:16 25 4
gpt4 key购买 nike

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

我尝试了指南中所示的方法:GDSL Guide .我遵循的步骤是:

  • 在我的项目主页中创建了一个 myDef.gdsl 文件(即在文件夹中
    包含 grails-app、web-app 等)
  • 在该文件中,我添加了以下代码:
    def ctx2 = context(ctype: "com.myPackage.MyClass")

    contributor(ctx2) {
    method(name: 'withLock', type: 'void', params: [closure: { }])
    }
  • 点击激活。

  • 但是当我这样做时,它仍然没有显示任何自动完成或识别:
    Myclass m = new MyClass()
    m.withLock() //This is not recognised

    我究竟做错了什么??? :(

    细节:
  • 创意系列:终极版
  • 创意版本: 107.535
  • 最佳答案

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

    关于grails - Intellij IDEA-Grails GDSL 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8429117/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com