简体   繁体   English

如何修复 WebStorm 中的“找不到要转到的声明”?

[英]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,当我按F3Ctrl + 单击功能时,我收到消息说“找不到要转到的声明”。 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.

相关问题 PhpStorm和JavaScript:我收到“找不到声明去” - PhpStorm and JavaScript: I'm getting “Cannot find declaration to go to” 如何修复“找不到模块 './commands/${file}'” - How can i fix “Cannot find module './commands/${file}'” Intellij IDEA:“找不到要转到的声明”- 新 javascript 项目中的消息 - Intellij IDEA: "Cannot find declaration to go to" - message in a new javascript project WebStorm中.vue文件中的ES6语法突出显示为错误。 我怎样才能解决这个问题? - ES6 syntax are highlighted as error in .vue files in WebStorm. How can I fix this? 如何修复“需要”的 WebStorm 警告“未解决的函数或方法”(Firefox 附加 SDK) - How can I fix WebStorm warning "Unresolved function or method" for "require" (Firefox Add-on SDK) react-scripts 启动错误(找不到模块'../scripts/start') - 我该如何解决这个问题? - react-scripts start error (Cannot find module '../scripts/start') - how can i fix this? Webstorm UT-找不到模块 - Webstorm UT - cannot find module 如何在WebStorm中转义? - How can I escape parenthesis in WebStorm? Java中嵌入的Javascript-如何进行声明? (Ctrl + B)(Nashorn)(IntelliJ) - Javascript embedded in Java - How can I go-to-declaration? (Ctrl+B) (Nashorn) (IntelliJ) 如何修复显示“找不到模块'mailosaur'”的错误 - How do i fix an error that reads "Cannot find module 'mailosaur'"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM