Page History
Servoy provides the following options for code formatting:
- Formatting code on save
- Project-specific formatting
- Force formatting the code base of entire projects
These . They are described in further detail belowin this chapter.
Stoc |
---|
Formatting Code
...
On Save
A project's code can be automatically formatted (line breaks, indentations, etc) on save. To do this, the project-specific settings must be activated:
- In Solution Explorer, select the currently active project and access the context menu (right-click).
- Click on Properties at the bottom.
- In the Javascript node, under Editor, click on Save Actions.
- Click the checkbox to Enable project specific settings. The checkbox option for Format source code on save will be un-grayed.
- Click the checkbox to Format source code on save.
Project-Specific Formatting
Different format profiles can be set for different projects. The information is saved to the SVN in team development environments, allowing all developers working on a project to use the same format profile.
...
- In Solution Explorer, select the currently active project and access the context menu (right-click).
- Click on Properties at the bottom.
- In the Javascript node, under Editor, click on Formatter.
- Click the checkbox to Enable project specific settings.
- Select a profile from the Drop-down list, or create/import a new profile using the respective buttons. (Note that you can also click on Edit to edit the default format profile.)
Info |
---|
Note: If you select New, you will be prompted to type in a Profile name with the option to open the Edit Profile dialog. This dialog provides customizable options for general settings, Indents, Braces, White Space, and Control Statements. See image below. |
Force
...
Formatting The Code Base Of Entire Projects
Several projects can be formatted at once using the following steps:
- Open the Script Explorer View using the main menu Window > Show View > Other > Dynamic Languages > Script Explorer.
- Select the project(s) on which you want to perform the formatting.
- Right-click to access the context menu (make sure your mouse pointer is hovering on top of a selected project).
- Click on the menu item Source > Format.