Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse JavaScript Editor: content assist for js files, autocompletion

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.

like image 877
Utaal Avatar asked Jun 17 '09 13:06

Utaal


People also ask

How do I enable JavaScript suggestions in Eclipse?

JavaScript Content Assist options can be configured from the JavaScript Content Assist preferences page. To configure JavaScript Content Assist options: Go to the JavaScript Content Assist preferences page, accessed from Window | Preferences | Web | JavaScript | Editor | Content Assist.

How do I download JavaScript editor in Eclipse?

To install just JSDT open 'Help > Install New Software...'. In "Work with" choose your main Eclipse site ( http://download.eclipse.org/releases/luna for Eclipse Luna). Click Next> to proceed with the install.

Does Eclipse IDE support JavaScript?

The JavaScript Development Tools (JSDT) provide plug-ins that implement an IDE supporting the development of JavaScript applications and JavaScript within web applications. It adds a JavaScript project type and perspective to the Eclipse Workbench as well as a number of views, editors, wizards, and builders.


1 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)

like image 50
Utaal Avatar answered Sep 29 '22 04:09

Utaal