简体   繁体   English

为什么Eclipse只能保存单独的JavaScript,HTML和CSS文件?

[英]Why is Eclipse so slow at saving individual JavaScript, HTML and CSS files only?

I am using Spring's bundle of Eclipse, STS version 3.6.0 which is based on Eclipse Kepler SR2 (4.3.2). 我正在使用Spring的Eclipse捆绑包,STS版本3.6.0,它基于Eclipse Kepler SR2(4.3.2)。 Eclipse performance is generally very good and if I save a Java file, it is instantaneous. Eclipse性能通常非常好,如果我保存Java文件,它是瞬间完成的。 However, when I try to save a JavaScript file it can take up to 3 seconds to save and the entire IDE is frozen during the process, which is very annoying and it actually impacts productivity. 但是,当我尝试保存JavaScript文件时,最多可能需要3秒才能保存,并且整个IDE在此过程中被冻结,这非常烦人,实际上会影响生产力。 I have done some digging and apparently, there are validators and such that cause slow down so I have tried turning these off but it doesn't make a difference. 我已经做了一些挖掘,显然,有一些验证器,这会导致减速,所以我试图关闭这些,但它没有任何区别。

The problem also occurs with CSS and HTML file types so I'm sure it's specifically with the web-development plugins. CSS和HTML文件类型也会出现问题,因此我确信它特别适用于Web开发插件。 Can anyone suggest a way of fixing this? 任何人都可以提出一种解决方法吗? I am willing to disable features to improve the save times if necessary. 如果有必要,我愿意禁用功能以改善保存时间。

Note: I am using stock version of STS - no extra plugins. 注意:我使用STS的库存版本 - 没有额外的插件。

At first I thought this was something to do with git, and disabling it did help a bit (see old answer below), but after some further use, the problem persisted. 起初我认为这与git有关,禁用它确实有所帮助(见下面的旧答案),但经过一些进一步的使用后,问题仍然存在。 Eventually, I realised that the problem is with the Package Explorer ! 最终,我意识到问题出在Package Explorer If I have the Link with Editor button selected and the package explorer tree is expanded, then Eclipse is eclipse is extremely slow at saving anything but Java source code. 如果我选择了Link with Editor按钮并且扩展了包浏览器树,那么Eclipse是eclipse在保存除Java源代码之外的任何东西都非常慢。 If I unselect Link with Editor and ensure the tree is collapsed, it all works fine. 如果我取消选择Link with Editor并确保树折叠,则一切正常。

Old Answer : 旧答案

Turns out this was related to egit somehow. 原来,这是相关egit莫名其妙。 I don't use the git integration in Eclipse so I just disabled git support for the project using the Team->Disconnect command. 我没有在Eclipse中使用git集成,所以我只是使用Team->Disconnect命令禁用了项目的git支持。

One possibility is corrupted eclipse .project and/or .settings. 一种可能性是eclipse.project和/或.settings被破坏。 I experienced up to 25 seconds delay. 我经历了长达25秒的延迟。 Try deleting those file/folder and recreate the project again. 尝试删除这些文件/文件夹并再次重新创建项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM