Eclipse JavaScript Editor: content assist for js files, autocompletion

Viewed 99296

I'm trying Eclipse (with JavaEE and Web Development plugins) as a JavaEE/GoogleAppEngine IDE. In HTML editor if I put a <script ... src="..." /> in <head> I automatically get content assist for JavaScript in the referenced file. I was wondering if it was possible to obtain content assist for other JavaScript files (e.g. jQuery or homebrew js library) inside JavaScript editor.

12 Answers

I just figured out how to obtain js content assist in Eclipse JavaScript editor (without Aptana plugins):

If the project type doesn't natively contain JavaScript Support: open Web (or JavaScript) perspective, right-click on the project and select Web Development Support > Add JavaScript Support (this won't hurt if JavaScript support is already present)

then right-click JavaScript Support within the project and select Properties, in the JavaScript section go to JavaScript library and then select Source tab: here you can add folders and files to be scanned by content assist for the current project


In Aptana Studio (as an eclipse plugin but I suppose the standalone version is almost the same): open any js or html file, show References window (or open Aptana perspective in eclipse) and drag-drop js files you want to add to JavaScript scope (it is possible to build and activate different scope profiles with different JavaScript files and resources: just click add profile in the window toolbar)

imo, Aptana is the best eclipse plugin for js editing. It includes support for many of the major libraries like jQuery, yui, dojo, etc.

Spket, however is also good. Though mostly if you do firefox extension development (getting a little out of date though)

The built in js editor is terrible. it claims there are errors all over the place even when there clearly are not.

Since 2019-06 you can use the "Wild Web Developer" plugin (aka WWD) which replaces many other plugins (Tern, AngularJS Eclipse, ...).

enter image description here

Edit HTML, CSS, JavaScript, TypeScript (+ESLint), JSON (+schema), XML (+schema), YAML (+schema), with specialized support for Angular, React and Kubernetes, and debug Node.js and HTML+JS web-apps simply and efficiently in the Eclipse IDE.

To see it in action, open the desired file with the Generic Editor that's included by default in the Eclipse IDE.

Supported file formats for edition:

HTML
CSS, SCSS, SASS, LESS
JavaScript (EcmaScript 2018 - 9th edition)
TypeScript 3.8
JSON and JSONC (including schema support)
YAML (including schema support)
XML (including schema support), XSL, XSD, DTD

Supported frameworks (file specialization) and linters for edition:

Angular (template assistance in HTML and TS files)
Kubernetes (schema built-in when editing YAML)
React (JSX, TSX, embedded HTML)
ESLint (including Typescript-ESLint)

Supported features for edition are

Validation (diagnostics, markers)
Code Completion
Hover
Outline
Rename refactoring
Jump to declaration
Find references
Color preview
... and other features part of the Language Server Protocol

Supported debugging target

Node.js
Firefox
Chromium and Chrome

For installation see github page.

Related