# Other enhancements

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:

1. Code wrap to the editor's window

2. Refreshing code completion

3. JavaScript Reference

4. Code templates

5. Easily edit JavaScript code embedded in HTML files.

### Code wrap

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:

### Refresh code completion library

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:

### JavaScript Reference

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:

1. From the JSEclipse menu > Reference library

2. By pressing the F1 key.

When accessed, the reference will open just like another Eclipse HTML document, in the workbench with the main index:

### Code templates

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:

### Easily edit JavaScript code embedded in HTML files

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:

1. Open your HTML file containing JavaScript code with the simple text editor in Eclipse.

2. Right-click within the code block in between the <script> tags. From the menu select the Edit in JSEclipse option:

3. A new temporary file will be created, containing only the JavaScript code. You can edit the file and add the desired changes.

4. Save your changes. They will be automatically copied into the original HTML file as well.