Contents
The HOCON Configuration File Editor is a validating HOCON editor that is aware of the structure that defines the HOCON syntax of StreamBase configuration files. The Editor validates StreamBase's extension of standard HOCON, which itself is an extension of standard JSON.
Invoke the HOCON Configuration File Editor in one of the following ways:
-
From the Project Explorer, double-click an existing
.conf
file from your project'ssrc/main/configurations
orsrc/test/configurations
folder. -
From Studio,
> > .
When you use the second method to create a new configuration file, Studio presents a dialog that offers to guide you through the file creation process.
- Guide Me tab
-
Allows you to search by property name to narrow down a list of HOCON types and root objects that support the specified property.
- Browse All Types tab
-
Allows you to choose the HOCON type and root object.
From the Guide Me tab, enter a search string in the search across type and property names field to reduce the list to HOCON types that match that string. For example:
To view a list of every available configuration type, click the Browse All Types tab. Enter a search string in the type filter text field to reduce the list to types that match that string.
Take advantage of the following features while editing your configuration files:
- Generate Sample Values
-
When creating a configuration file, the Editor presents the option to generate every available configuration property for the specified HOCON configuration type. These properties, when generated, include descriptive comments.
- Typechecking Support
-
The Editor typechecks your configuration file as you compose or edit it. The Editor places a red X () marker on the left margin next to lines that fail to pass, and places a red location marker in the scroll bar. Hover the mouse over the red X icon on the left or the location marker on the right to see a text message explaining the error detected. Press F2 to see long error messages wrapped into readable format.
- Syntax Color Coding
-
In Source view, the Editor provides syntax color coding of the HOCON text.
- Mouseover Property Description
-
Place your mouse over a property or object to view a description of it.
- Autocompletion
-
When typing a new property, press Ctrl+Space after the first few letters. The Editor shows its content assistance window with one or more candidates to complete the property. If there is one candidate, press Enter to complete it.
- Tag Proposal of Default Properties
-
Place your cursor after an opening curly brace, then Ctrl+Space. The Editor's content assistance window shows you all the default properties and their values that are valid to enter in the current location. Selecting
<defaults>
populates the configuration file with the appropriate properties.
It is a best practice using the HOCON Configuration File Editor in Studio to edit all configuration files. If you use a different editor, be sure to load the resulting file at least once into Studio's HOCON Configuration File Editor so that your edits can be confirmed as valid.
Note
It is not recommended editing a project's HOCON configuration file in another editor outside of Studio while Studio is running. Nevertheless, if you do so, you must perform the following steps in this order:
-
Refresh the Studio project after such external edits. That is, select the project in the Project Explorer view, right-click, and select F5).
from the context menu (or select the project and press -
Refresh the project's typecheck environment. That is, select the project in the Project Explorer view, right-click, and select Ctrl+F5).
> from the context menu (or select the project and press
The StreamBase Configuration Forms Editor is a forms-based editor for configuration files (HOCON). On the top-right corner of the HOCON text editor, there is a button "Open in forms editor" which allows you to edit this file with the StreamBase Configuration Forms Editor.
The forms editor consists of the following sections:
- StreamBase Configuration Forms Editor section
-
Displays a link and a button:
-
A link is displayed when warnings/errors exist in the editor. This is updated as the user edits the content. Clicking the link will open the 'Errors/Warnings' tab in the Additional Information section. After the file is saved, any issue will also be shown in StreamBase Studio's problems view.
-
A button on the top-right corner of the editor will open the file in a text editor. The two editors will attempt to reconcile as the user makes changes. Making changes using one editor, and opening the file in a different editor without saving, will trigger Studio to ask if the changes are to be saved or discarded. It is recommended to use editors separately (saving before attempting to make changes with the other).
-
- File Contents Being Edited section
-
Displays the content of the file hierarchically using a tree viewer. When selecting an element,the details section to the right will be updated with the information of the selected element. Edit the non-container elements (strings, booleans, numbers) directly on the tree or by using the controls in the Details section.
- Details section
-
Shows the used (configured) properties, available properties, and controls to add elements when available.
- Additional Information section
-
Shows information on the editor's selection, as well as detailed messages for warnings and errors. The additional information section consists of the following two tabs that can be helpful when writing configurations.
-
Information: Shows the information of the selected configuration element such as description of the element, the element type, any default values, and sub-elements if this element is of type object.
-
Errors/Warnings: Displays the errors/warnings in the configuration file.
-
- Outline section
-
Shows the Configuration tree in the editor.