Code Editors¶
Studio has three kinds of code editor:
- Code editor: for operations, controller actions, events and any other back-end code that your application needs.
- CSS editor: for custom CSS rules of your forms.
- JavaScript editor: for custom scripts of your forms.
The editors share most of the features below. See Features availability for the differences. The examples use the code editor, which has the most features.
The toolbar¶
Above the code editor there is a row of buttons:
| Button | What it does | Shortcut |
|---|---|---|
| Language Reference | Opens the language reference | - |
| Find | Searches in the code | Ctrl + F |
| Replace | Searches and replaces | Ctrl + H |
| Toggle Comments | Adds or removes comments on the selected lines | Ctrl + / |
| Fill Operation Description | Fills in the description of the operation | - |
| Maximize (at the right) | Gives the editor all the available space | - |
Features¶
Auto-completion¶
The code editor can suggest correct values while you type: when it detects a known term, when you type a mark such as a dot, and when you press Ctrl + Space. Use the arrow keys to browse the list and Tab to accept a suggestion. Accepting a term completes it, and accepting a construct such as foreach generates an empty template.
Attention
If your code is incorrect, suggestions might stop. If you do not see them, validate the code and correct the mistakes.
Errors¶
A line with invalid code is marked with a red sign in the margin, as in the screenshot above.
Language reference and links¶
The Language Reference button opens the knowledge base of the language, with a search box and anchors. Under the editor, Studio shows the symbol under the cursor, for example Domain.User, as a link. Click it to open the reference page of a data type or operation, or, for classes and operations that you defined yourself, to go to its definition.
Features availability¶
| Feature | Available for | Comments |
|---|---|---|
| Auto-completion | Code and CSS | |
| Help and language reference | Code | |
| Search | All | In the JavaScript and CSS editors, by shortcut only |
| Search and replace | All | In the JavaScript and CSS editors, by shortcut only |
| Add or remove comments | All | In the JavaScript and CSS editors, by shortcut only |
| Maximize | Code | |
| Collapsible blocks | All | |
| Errors | Code and JavaScript |
