|
Aside the major code completion, navigation and error reporting enhancements brought forth for the JavaScript developers, JSEclipse also comes with some smaller, but very useful options:
One of the smaller enhancements brought by JSEclipse for the JavaScript developers is to allow code wrap in the Eclipse workbench editor window. This helps when writing long lines of code that extend beyond the visible editor surface, making the code easier to read. For example, a long variable definition can be made much more clear:
To enable code wrapping to window, select the Edit menu > Word wrap option:
Now, the variable definition is shown entirely in the editor:
When the code completion feature does not display the latest functions or variables added to the project, its library might need refreshing. This determines a new parse of all *.js files in the current project, refreshing the list of class methods, functions and variable names. To access the refresh command, select the JSEclipse menu option, and then the Refresh code completion library:
JSEclipse has embedded the basic JavaScript function reference into the plugin, so now when you are in a hurry to develop and need to take a peek at one function, you can open it directly in Eclipse.
The Reference library can be accessed in two ways:
From the JSEclipse menu > Reference library
By pressing the F1 key.
When accessed, the reference will open just like another Eclipse HTML document, in the workbench with the main index:
JSEclipse allows you to define and use templates for the bits of code that you use most often. To view existing templates, edit or add one, go to Window > Preferences > JSEclipse > Templates.
To apply a template, start typing the first letters of the name, and from the code completion dialog select the entry marked as a template:
When you have JavaScript code in your HTML files, it is somewhat cumbersome to edit using the simple text editor. You could copy the code into a separate .js file and edit it using JSEclipse, and then copy the changes back. But with JSEclipse there is an easier way to do it:
Open your HTML file containing JavaScript code with the simple text editor in Eclipse.
Right-click within the code block in between the <script> tags. From the menu select the Edit in JSEclipse option:
A new temporary file will be created, containing only the JavaScript code. You can edit the file and add the desired changes.
Save your changes. They will be automatically copied into the original HTML file as well.