Webstorm 项目窗格中缺少文件夹
我在WebStorm中构建了一个项目,然后将该项目提交到GitHub。
当我重新启动计算机并重新启动 WebStorm(和项目)时,我在项目窗格中只能看到根文件,并且没有任何文件夹(是的,文件夹在那里)
请参阅下图以供参考。
有谁知道如何让这些文件夹重新出现在 Webstorm 的项目窗格中?
I've built a project in WebStorm and then submitted the project to GitHub.
When I rebooted the computer and relaunched WebStorm (and the project), all I can see in the project pane is the root files, and none of the folders (yes the folders are there)
See the image below for reference.
Does anyone know how I can get those folders to re-appear in the project pane of Webstorm?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
在项目根目录中找到 .idea/modules.xml
确保这些行正确:
将 NameOfYourProject.iml 替换为您的项目名称。
然后,确保文件 .idea/NameOfYourProject.iml 存在,如果不存在,则创建它并将其放入其中:
Find the .idea/modules.xml in your project root
make sure that these lines are correct :
Replace NameOfYourProject.iml with the name of your project.
Then, make sure that the file .idea/NameOfYourProject.iml exists, if not , create it and put this in it :
您不需要删除整个 .idea 文件夹并重新配置整个项目,只需
You do not need to delete whole .idea folder and reconfigure your whole project, just
我遇到了同样的问题并通过使缓存失效来解决它。
该选项位于“文件”>“使缓存无效/重新启动。
在提示中单击“无效并重新启动”。
注意:执行此操作之前需要打开相关项目。
I ran into the same issue and resolved it by invalidating the cache.
The option is under File > Invalidate Caches/Restart.
On the prompt click Invalidate and restart.
Note: The project in concern needs to be open before you do this.
我时常看到这一点。我使用 Git,并将 .gitignore 文件设置为 推荐,具体来说:
我有时在克隆存储库后会看到这一点,当试图找出原因时,我遇到了这篇文章并阅读已接受的答案。
我删除了
modules.xml
文件,重新打开WebStorm(2016.2.4),就解决了。我查看了新的modules.xml
,发现它的内容与以前完全相同,但我的.iml
文件更大。因此,这似乎是
.iml
文件中的损坏,而不是modules.xml
中的损坏。我假设删除modules.xml
会触发.iml
文件的重建。不确定这是否对任何人有帮助,但我想我会提供额外的见解。I see this from time to time. I use Git, and I have my .gitignore file set up as recommended, specifically:
I sometimes see this after cloning the repository, and when trying to figure out why, I came across this post and read the accepted answer.
I deleted the
modules.xml
file and reopened WebStorm (2016.2.4), and it was resolved. I looked at the newmodules.xml
and found that its contents were exactly the same as before, but my<projectName>.iml
file was bigger.So it seems to be a corruption in the
.iml
file, notmodules.xml
. I assume that deletingmodules.xml
triggers a rebuild of the.iml
file. Not sure if this helps anyone with anything, but thought I would offer the extra insight.36楼解决了我的问题。在WebStorm 11中
有时会在WebStorm 9中发生。对我来说修复它的最简单方法:
floor 36 solve my problem. in WebStrorm 11
It happens sometimes in WebStorm 9. The easiest way to fix it for me:
尝试删除workspace.xml和watchertask.xml,然后重新启动IDE。您必须在所有文件夹中看到完整的源代码。
Try deleting workspace.xml and watchertask.xml then just restart the IDE. You must see your full source code in all folders there.
最后我找到了罪魁祸首,它是来自 https://plugins.jetbrains.com/plugin/7961-team-foundation-server--version-control-integration/
我查看了
system/log/idea. log
文件,发现每当我将新文件夹作为新项目打开并破坏内容根
自动检测时,该插件都会产生 Null 异常通过 IDE,卸载后插件,所有文件夹都按其应有的方式显示。您可能因为罪魁祸首插件而遇到此问题,并且在出现此问题之前禁用最近刚刚安装的插件可以解决此问题。检查日志文件并搜索
ERROR
。如果发现它是您正在积极使用且不愿意禁用的重要插件,则临时修复方法是打开
设置->目录
并单击< strong>添加内容根
按钮添加项目的根文件夹,单击确定
现在文件夹将显示,索引将显示开始,当然,每次打开新文件夹时都必须执行此操作作为新项目。Finally I found the culprit, it was
Team Foundation Server - Version Control Integration
plugin from https://plugins.jetbrains.com/plugin/7961-team-foundation-server--version-control-integration/I looked at the
system/log/idea.log
file and found that this plugin was producing Null exception whenever I open a new folder as a new project and breaks thecontent root
auto detection by the IDE, and after I uninstalled this plugin, all folders show up as it should.You might have this issue because of a culprit plugin, and disabling those which you have just installed recently just before this issue occurs, will resolve the issue. Check the log file and search for
ERROR
.If it is found to be an important plugin you are actively using which you are not willing to disable, then a temporary fix is to open
Settings->Directories
and clickAdd content root
button to add the root folder of your project, clickOk
now folders will show up and indexing will begin, and of course you have to do this everytime you open a new folder as new project.它可能是由损坏的
.idea/modules.xml
项目文件引起的。您可以尝试手动修复它(从本地历史记录、版本控制或备份恢复)或从头开始创建新项目。检查此问题以获取提示/解决方法。
It can be caused by the corrupted
.idea/modules.xml
project file. You can either try to fix it manually (restore from Local History, version control or backup) or create the new project from scratch.Check this issue for the hints/workarounds.
在 WebStorm 9 中有时会发生这种情况。
对我来说最简单的修复方法是:
It happens sometimes in WebStorm 9.
The easiest way to fix it for me:
解决方案:
从现有源创建一个新项目
为什么采用此解决方案:
以 .idea 和 .idea 的各种组合进行编辑和删除XML 文件没有为我解决问题。因此就有了上面的解决方案。备份您的 .idea 目录,以防您想要保留项目自定义内容。这可能会覆盖它们。
结果:
我创建的所有各种文件夹现在都可见,并且该项目按预期工作。 .idea 目录现在已正确格式化,包含所有必要的文件。
Solution:
Creating a new project from existing sources
Why this solution:
Editing and deleting in various combinations of .idea and XML files did not solve the issue for me. Hence the solution above. Back up your .idea directory in case you have project customizations you want to keep. This likely overwrites them.
Outcome:
All the various folders I had created were now visible and the project worked as expected. The .idea directory was now formatted correctly with all the necessary files.