The SIL™ Editor
The SIL™ editor is the central point where you develop your scripts. It offers basic text editing: syntax highlighting, autocomplete, a source file management across all defined trees, the possibility to run a script and to view the log of the instance. For all scripts that reside in the virtual directories, this tool offers the power of SIL™ at your crafty fingertips.You can edit various files here, not only scripts, although this is the main view, and selected by default. Just click the View dropdown and select what you want to edit. cPrime Home points to our aliases files and templates, so you can switch between those views.
When you select a file in the script browser, its contents is loaded to the editor. When you are editing the script, three important actions are also available:
- Check - checks the syntax of the script
- Save - saves the script in the storage (either a file or a database)
Run - runs the current script in the global context or in a provided one (if you set it in the run configuration). The results will be displayed on the console tab, at the bottom of the page.
This feature is available starting with v4.5.0 of the power apps.After you press the "Run" button, the view will be changed to the console (a scroll-down will be called). If you want to disable the auto scrolling to the console, you can click the "Settings" button and then check the "Disable focus change".
Menus are all contextual. With the right click you open the contextual menu where you can perform actions related to that item:
- New File / New Folder actions are available only for the folder nodes. Clicking them will ask you the name of the file or directory to be created on the server side.
- Delete action is available for both directories (folders) and files. It deletes the file or directory. You cannot delete a directory unless it's empty.
- Rename action is also available for both directories and files.
- Refresh action is available for directories, and it rescans the virtual files below the selected levels and re-populates the tree with entries found on the server-side, either from the disk or a database storage.
- Storage options for individual script files.
Access contextual menu from the Selection drop-down box.
Note that the delete and rename operations are performed without checking for usages. If your script is already used, for instance in a post function for a certain workflow, deleting or renaming it will break that workflow. Be careful when performing these operations.
The editor also offers basic search and replace facilities for the current selected file, as well as a full-screen mode, if you want to fully concentrate on your script.
When you select a folder, you can start typing in the search box to find files by name. Note that it searches files and folders recursively and also looks inside folders under the currently selected one.
By default, the scripts are run using the global context (without assuming any issue key). By clicking the Run configuration button, you will be able to set a provided context to run the issue for.
To discover usages of the current file loaded into the editor, click Show Usages. Now you can view the usages of the current script in includes, listeners, workflows, and so on. As you install other cPrime apps that can use scripts for their features, those usages show up here as well.
Note that a file A included (see Inclusions) into another file B is shown as being used only if B is being used directly for a feature. If B is not used directly, but is included into another file C that is used directly by a feature, file A is not shown as being used.
Console / Log Viewer
Starting with v4.5.0 we have added the Log Viewer feature to the SIL™ Manager.
At the bottom of the page there is a tab menu which allows you to switch between the console and log views.
The console view will display the results from the run of a script while the data from Jira's log will be loaded in the log view. The log view will be filled automatically you run a script.
You can also manually reload the log file and change the default settings for the data to be loaded.
We've implemented several keyboard shortcuts to make your life easier when working with SIL™ scripts.
|Shift + Enter||Check the SIL code|
|Ctrl + S||Save|
|Ctrl + /||Toggle line comment|
|Ctrl + Shift + /||Toggle selection comment|
|Ctrl + Space||Show autocomplete suggestions|
|Ctrl + K||Go to next occurrence of selection|
|Ctrl + Shift + K||Go to previous occurrence of selection|
|Ctrl + L||Jump to line|
|Shift - Tab||Outdent selection|
|Alt - Up/Down||Move line up/down|
|Alt - Shift - Up/Down|
Copy line up/down
|Ctrl - D||Delete line|
We're looking forward to hearing what you think of the SIL™ Manager and are happy to accept your ideas for new features too.
Credits for the editor go to the Ace editor.