Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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). Especially it's impossible for several minutes to edit file after inserting a dot in 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%. If anyone knows The problem please help me.

like image 355
Zura Sekhniashvili Avatar asked Feb 22 '13 10:02

Zura Sekhniashvili


2 Answers

You can run into these kind of issues with Eclipse :-)

I'm using Eclipse since 2005, had seen a lot of things. Here are some hints may help you out.

I don't know which version you are using. Which Eclipse package? Kepler, Indigo - it is one thing. But there are a lot of packs. For Java, for PHP (with PDT), C++, etc.

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.

In the begining I had one Eclipse installed and tried to add all plugins into that Eclipse. Tried to use the same Eclipse for Java, PHP, ActionScript projects. It didn't work!
So my first advise: deploy more Eclipse versions and use each for different type of projects!
Now I have one Eclipse for Java, one for PHP and another for ActionScript developments.

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.
You may try to google for DLTK problems with your Eclipse version. You may also change setup of Dynamic Languages, mostly you should try to switch off/on and change parameters of DLTK cache.
It is also possible that your DLTK index is messed up. You can force Eclipse DLTK to flush its index. It is stored in an SQL-like stuff under Eclipse, you can Google how to clean that index.

And there is another possibility: version tracking, mostly Git may cause "eating my CPU" problems.
Each time you type a new character into your file Git could be triggered to check differences. 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.

And one more thing: Project / Build automatically
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
2. Do not install any plugin - only your version tracker if you are using any
3. Import your project, and try immediatelly if the problem occurs
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
5. if no, that is a good news. then you may start to add the plugins you use/need

Maybe this helps...

like image 192
Attila Wind Avatar answered Sep 21 '22 07:09

Attila Wind


This is happens because eclipse scan and validate your javascript against any plugins that you installed on your project. you can skip this by going to : Project > Properties > Javascript > Include Path > Source > Edit Excluded path and add your JS files or folders.

like image 36
kartamihardja Avatar answered Sep 20 '22 07:09

kartamihardja