[英]How can I fix “cannot find declaration to go to” in WebStorm?
I'm using WebStorm with JavaScript and when I press F3 or Ctrl + Click on function I get message that say "cannot find declaration to go to".我正在使用带有 JavaScript 的 WebStorm,当我按F3或Ctrl + 单击功能时,我收到消息说“找不到要转到的声明”。 This happens only in functions that I wrote on my computer, with other functions it works great.
这仅发生在我在计算机上编写的函数中,其他函数效果很好。
I wrote my functions declarations exactly like all the other functions that go to declaration works for them.我编写了我的函数声明,就像所有其他用于声明的函数一样。 I'm using Ultimate version.
我用的是终极版。
I tried File->Invalidate cache\\Restart...
and it didn't work.我试过
File->Invalidate cache\\Restart...
但它没有用。
Any suggestions?有什么建议?
EDIT: Example of the function:编辑:函数示例:
FaasInitUtils.prototype.createCompnentData = function createCompnentData(app) {
}
when I call this function I do it like this:当我调用这个函数时,我是这样做的:
FaasInitUtils.prototype.configureSiteCdmRT = function configureSiteCdmRT() {
var componentData = this.createCompnentData(app);
}
I manged to fix it.我设法解决了它。 I had a lot of projects and big one in Webstorm, what I excluded target folders and then everything started to work (including colors).
我在 Webstorm 中有很多项目和大项目,我排除了目标文件夹,然后一切都开始工作(包括颜色)。 So I think that there is a problem with the configuration of memory limitation/consumption.
所以我认为内存限制/消耗的配置有问题。
My case:我的情况:
go to WebStorm Default IDE directories (C:\\Users\\JohnS\\AppData\\Roaming\\JetBrains)转到 WebStorm 默认 IDE 目录 (C:\\Users\\JohnS\\AppData\\Roaming\\JetBrains)
delete all files in this folder删除此文件夹中的所有文件
reopen WebStorm重新打开 WebStorm
WARNING: But after these steps your JetBrains products configuration will be reset.警告:但在这些步骤之后,您的 JetBrains 产品配置将被重置。 So u can try to delete this folder WebStorm2020.1 (the name depends on WebStorm version) first and try is this will solve the problem, if not do my steps.
所以你可以先尝试删除这个文件夹WebStorm2020.1(名称取决于WebStorm版本),然后尝试是否可以解决问题,如果不这样做,请执行我的步骤。
These steps fix for me this bug.这些步骤为我修复了这个错误。 This article helps me to find Default IDE directories for my OS: https://www.jetbrains.com/help/webstorm/tuning-the-ide.html#default-dirs
这篇文章帮助我找到我的操作系统的默认 IDE 目录: https : //www.jetbrains.com/help/webstorm/tuning-the-ide.html#default-dirs
Long shot: I had the same problem.远射:我遇到了同样的问题。 For some reason in Preferences -> File Types -> JavaScript : there wasn't any pattern matching *.js files.
出于某种原因,在 Preferences -> File Types -> JavaScript 中:没有任何模式匹配 *.js 文件。 I added *.js and then it worked.
我添加了 *.js 然后它起作用了。 Cheers
干杯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.