简体   繁体   English

编辑javascript文件时eclipse停止工作

[英]eclipse stops working when editing javascript file

My eclipse stops working and gives me error ("eclipse requesting javascript AST from selection has encountered a problem") when I open javascript file to edit in eclipse. 当我打开javascript文件在eclipse中编辑时,我的eclipse停止工作并给我错误(“eclipse请求选择中的javascript AST遇到问题”)。 That problem occurred in eclipse indigo, but now I have the latest version of eclipse (eclipse kepler) and eclipse does the same(stops working and gives me error). 这个问题发生在eclipse indigo中,但现在我有了最新版本的eclipse(eclipse kepler)和eclipse也一样(停止工作并给我错误)。 Especially it's impossible for several minutes to edit file after inserting a dot in eclipse. 特别是在eclipse中插入一个点后几分钟就不可能编辑文件。 And generally without dot it's also very annoying to edit file, because I have to wait for minutes after writing something.And also my CPU work on 90%-95%. 一般没有点,编辑文件也很烦人,因为我必须在写完东西后等待几分钟。而且我的CPU工作在90%-95%。 If anyone knows The problem please help me. 如果有人知道问题请帮助我。

You can run into these kind of issues with Eclipse :-) 你可以用Eclipse遇到这些问题:-)

I'm using Eclipse since 2005, had seen a lot of things. 我从2005年开始使用Eclipse,看过很多东西。 Here are some hints may help you out. 这里有一些提示可能会帮助你。

I don't know which version you are using. 我不知道你使用的是哪个版本。 Which Eclipse package? 哪个Eclipse包? Kepler, Indigo - it is one thing. 开普勒,靛蓝 - 这是一回事。 But there are a lot of packs. 但是有很多包。 For Java, for PHP (with PDT), C++, etc. 对于Java,PHP(带PDT),C ++等。

The difference is: the installed plugins. 不同之处在于:已安装的插件。 In general we can say you have more chance to run into issues like this if you have more and more plugins installed under Eclipse. 一般来说,如果你在Eclipse下安装了越来越多的插件,我们可以说你有更多机会遇到这样的问题。

In the begining I had one Eclipse installed and tried to add all plugins into that Eclipse. 在开始时我安装了一个Eclipse并尝试将所有插件添加到Eclipse中。 Tried to use the same Eclipse for Java, PHP, ActionScript projects. 试图使用相同的Eclipse for Java,PHP,ActionScript项目。 It didn't work! 它没用!
So my first advise: deploy more Eclipse versions and use each for different type of projects! 所以我的第一个建议是:部署更多的Eclipse版本,并将它们用于不同类型的项目!
Now I have one Eclipse for Java, one for PHP and another for ActionScript developments. 现在我有一个Eclipse for Java,一个用于PHP,另一个用于ActionScript开发。

The other thing: Eclipse language plugins are using the Dynamic Language Toolkit (DLTK) for parsing the differences/structures you type in. If it is slow, you are stucked like this. 另一件事:Eclipse语言插件使用动态语言工具包(DLTK)来解析你输入的差异/结构。如果它很慢,你就像这样陷入困境。
You may try to google for DLTK problems with your Eclipse version. 您可以尝试使用Eclipse版本谷歌搜索DLTK问题。 You may also change setup of Dynamic Languages, mostly you should try to switch off/on and change parameters of DLTK cache. 您也可以更改动态语言的设置,大多数情况下您应该尝试关闭/打开并更改DLTK缓存的参数。
It is also possible that your DLTK index is messed up. 您的DLTK索引也可能搞砸了。 You can force Eclipse DLTK to flush its index. 您可以强制Eclipse DLTK刷新其索引。 It is stored in an SQL-like stuff under Eclipse, you can Google how to clean that index. 它存储在Eclipse下的类似SQL的东西中,你可以谷歌如何清理那个索引。

And there is another possibility: version tracking, mostly Git may cause "eating my CPU" problems. 还有另一种可能性:版本跟踪,主要是Git可能导致“吃掉我的CPU”问题。
Each time you type a new character into your file Git could be triggered to check differences. 每次在文件中键入新字符时,都可以触发Git来检查差异。 It happened with me once, the effect was similar you are experiencing. 它发生在我身上一次,效果与你正在经历的相似。 I had to change Git cache config, I raised the ammount of cache for a huge value. 我不得不改变Git缓存配置,我提出了大量的缓存以获得巨大的价值。

And one more thing: Project / Build automatically 还有一件事:Project / Build自动生成
You may also try to switch that off. 您也可以尝试将其关闭。

So I would suggest the following: 所以我建议如下:

1. Download and deploy a brand new Eclipse (the all-in-one for PDT (PHP development) has nice Javascript language plugin inside) - this way you will have an empty, clean DLTK index for sure 1.下载并部署一个全新的Eclipse(用于PDT的一体化(PHP开发)里面有一个很好的Javascript语言插件) - 这样你就可以获得一个空的,干净的DLTK索引
2. Do not install any plugin - only your version tracker if you are using any 2.如果您使用任何插件,请不要安装任何插件 - 仅限您的版本跟踪器
3. Import your project, and try immediatelly if the problem occurs 3.导入项目,如果出现问题,请立即尝试
4. if yes, try older Eclipse versions (it is my general experience new versions has instability in the first 6 months with languages), repeat the same steps 4.如果是,请尝试较旧的Eclipse版本(这是我的一般经验,新版本在前6个月内使用语言不稳定),重复相同的步骤
5. if no, that is a good news. 如果不是,那是个好消息。 then you may start to add the plugins you use/need 然后你可以开始添加你使用/需要的插件

Maybe this helps... 也许这有助于......

This is happens because eclipse scan and validate your javascript against any plugins that you installed on your project. 这是因为eclipse扫描并验证您的javascript与您在项目上安装的任何插件。 you can skip this by going to : Project > Properties > Javascript > Include Path > Source > Edit Excluded path and add your JS files or folders. 您可以跳转到:项目>属性> Javascript>包含路径>源>编辑排除的路径并添加您的JS文件或文件夹。

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

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