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/