grails - Intellij w/Grails : Cannot resolve symbol for inherited params and methods

标签 grails intellij-idea

Intellij 提示 cannot resolve symbol很多时候,当我尝试访问在我的 Grails 应用程序中继承的变量或方法时。这些应用程序编译并运行良好,因此实际上没有任何问题,但 IDE 让它看起来好像有。很难弄清楚什么时候真的存在问题,或者我只是得到了误报。作为一个刚接触 Grails 并正在努力学习的人,我发现自己将头撞在墙上,试图修复结果甚至没有损坏的东西。

例如:

class GlobalParamsInterceptor {
    def SysConfigService sysConfigService;

    GlobalParamsInterceptor() {
        matchAll();
    }

    boolean before() {
        true
     }

    boolean after() {
        model.isApplicationOpen = sysConfigService.isApplicationOpen();
        model.context = grailsApplication.getMainContext();

        true
    }

    void afterView() {
        // no-op
    }
}
matchAll() model grailsApplication都被标记为未解析的符号,但它们实际上是有效的。我正在使用 Intellij 的 Ultimate 版本,它应该支持 Grails,所以我认为它应该能够解决这些问题,对吗?

最佳答案

I am using the Ultimate edition of Intellij which is supposed to support Grails so I would assume it should be able to figure these things out right?



一般来说,它确实如此。在某些地方,IDEA 无法识别混入某些工件的特征,这就是一个例子。代码应该仍然可以编译并运行良好。我不知道是否已经有针对此功能的功能请求,但我会向 IDEA 人员提及。

关于grails - Intellij w/Grails : Cannot resolve symbol for inherited params and methods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35927395/

相关文章:

sql - GORM - 动态查询 - 分离标准?

grails - Gant脚本缓存导致问题

javascript - RubyMine 代码重新格式化不尊重 ESLint 配置

java - Android Consumer IR Manager 必须是 : 之一

spring - 未为文件 Intellij IDEA 配置文件集

intellij-idea - 将ScalaTest的BeforeAndAfterAll特性与sbt和IntelliJ IDEA一起使用的正确方法是什么?

grails - 在 Grails 中查找 session 用户的公共(public) IP 地址

Eclipse -> 调试 -> 表达式不起作用

grails - 删除项目后如何保持查询结果?

intellij-idea - 构建 IntelliJ 的 Artifacts 键盘快捷键