Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Autocomplete JavaScript

I am using Eclipse IDE for PHP and now that I started using also JS I am missing the autocomplete options. I do not know if they're missing because I did something wrong or because the variables are not defined yet (similiar to MATLAB). Autocomplete works great with PHP, HTML and CSS but not with JS. I tried the classic

> Window > Preferences > JavaScript > Editor > Content Assist > Advanced

and

Installing extensions

but it did not help. I also tried to reference to some external files, but I am pretty sure that's not what is wrong.

I've been searching the whole day and I did not find an actual answer. As Eclipse has so many multiple options to adjust everything, I am getting a bit overwhelmed with that...

I would appreciate someone explaining to me how the autocompletion works. Where and whwn does it look for the suggestions (definitions in the js file or in the whole script) and why does it not show the DOM methods like window.onload or document.getElementById for example. Is this normal because there is no window/document yet or do I have to check some checkboxes in order to make eclipse do that?

like image 948
elserra Avatar asked Jul 01 '18 06:07

elserra


People also ask

How to enable autocomplete in Java editor?

Go to Preferences > Java > Editor > Content Assist and write .abcdefghijklmnopqrstuvwxyz in the Auto activation triggers for Java field. See this question for more details. Use the Ctrl+Space shortcut for getting all possible autocomplete options available in a particular context in the editor.

Does Eclipse IDE support JavaScript auto-complete/content assist?

I have Eclipse IDE. I have installed the Aptana studio plugin for Eclipse. I am editing an HTML file. JavaScript auto-complete / content assist only works half of the time: Eclipse won’t content assist my functions and variables between <script> tags. But it will work for core JavaScript items.

How to enable auto-completion in Eclipse?

Window -> Preferences -> Java -> Editor -> content assist. See if the "completion inserts" is checked off along with anything else there you want to help auto complete. Pressing Ctrl + Space opens up the auto-completion dialog in Eclipse.

How to auto complete code in Eclipse?

Steps: 1 In Eclipse, open the code auto completion box from first letter 2 Go to >> Window >> preference >> [ Java c++ php ... ] >> Editor >> Auto activation triggers for... 3 Add the character SPACE by just putting your cursor inside and box and push the space key.. More ...


1 Answers

The best content assist (and validation and more) for JavaScript and all dynamic web languages is available in the CodeMix plugin for Eclipse.

Here's a specific comparison between Eclipse JSDT and CodeMix.

You can install CodeMix from the Eclipse Marketplace here.

Hope that helps!

like image 77
Todd Williams Avatar answered Oct 18 '22 00:10

Todd Williams