facebook
Webclipse

Using Source Formatting for JavaScript with JSjet

Quickly format either highlighted sections or the entire JavaScript file. JSjet includes a rich understanding of syntax, including ES6, resulting in proper indentation of your JavaScript code with a simple click of the mouse.  Source formatting for JavaScript with JSjet is available in Webclipse or MyEclipse.

Back to Learning Center

JSjet was introduced in version 2016 CI 3 of Webclipse and MyEclipse.

 

Source Formatting for JavaScript

You can quickly format either highlighted sections or the entire JavaScript file from the JavaScript editor. Place your cursor anywhere in the file to format the entire file or select a section of code to format only a specific section. Choose one of the following methods for to format your code:

  • Select Format from the Source menu
  • Right-click and select Source>Format
  • Press Ctrl+Shift+F
JSSourceFormattingComp

Source formatting

 

Commenting Lines

To make one or more lines of code a comment, select the lines to comment, and press Ctrl+Shift+C. This shortcut is a toggle, and will remove comment marks, as well.

 

Setting Preferences for the Source Formatter

There are a number of preferences you can set for source formatting. To access these preferences in Webclipse, go to Windows>Preferences>JavaScript>Code Style>Formatter. Or, in MyEclipse, go to  Windows>Preferences>MyEclipse>JavaScript>Code Style>Formatter.

JSFormatterPref
Setting preferences for source formatting