The Method Editor is the main tool you use in Omnis Studio to write and debug Omnis code, and we are constantly looking for ways to improve it, to make it easier and quicker to create web and mobile apps in Omnis. The major enhancement in recent releases has been the addition of the Code Assistant, a popup helper showing code syntax etc, and with the Studio 8.1 release in August we have added a few more enhancements to help you write Omnis code.
Code Assistant Enhancements
In the latest Studio 8.1.x release the behavior of tabbing while using the Code Assistant has changed, although you will need to enable the new behavior in the Omnis configuration file. There is a new item in the ‘codeAssistant’ entry in config.json, called ‘tabAlsoLeavesFieldAfterClosingAssistant’, to control the behavior when tabbing out of the variable name or calculation box in the method editor; when set to true (and ‘oldTabReturnBehaviour’ is false) then a tab will close the code assistant and the cursor will move to the next field in the tabbing order.
In addition, the Code Assistant now recognises custom properties, i.e. properties of an instance or an instance object, implemented using two methods, $propname and $propname.$assign. The Code Assistant combines these into a single property in the list of completions rather than showing the two methods.
Displaying Control Characters
In Studio 8.1.x it is now possible to display Control characters in data or content when inspecting a variable in the Method Editor. The Field Value window and Values list window, displayed when you Right-click on a variable, now have a menu that allows you to: Show characters normally, Show all control characters, or Show all control characters except carriage return. The menu also allows you to increase and decrease the font size used for all content except the binary data.
The control characters are displayed using the Unicode page 0x2400 which has visual representations of control characters, in addition to characters 0-0x1f, 0x7f (del) is also treated as a control character. Control characters are also shown in the Catalog status bar, Variable value tooltips and Variable context menus.
The way comments from inherited methods are handled and displayed has changed in Studio 8.1.x. Any comments in overridden methods are no longer added to inherited methods, instead the comments are shown in a new comments field on the left-hand side of the ‘Notes’ tab in the Variable pane in the Method Editor. Comments for both the immediately overridden method, and for any other implementations further up the inheritance tree are shown. This means your code is not cluttered with comments, and in addition the comments in the new field stay up to date if you edit the comments in a superclass method.
There is a new entry in appearance.json file called “overriddenmethodstyle” which is the text style used to indicate an overridden method in the method editor tree. The default is to show methods that override a superclass method in bold.
In addition, the Inherit method or Override method options are now present in the method editor Modify menu when it is appropriate to include the command. Both have the shortcut Ctrl+Shift+I to inherit or override the current method.
Method lines that are longer than 255 characters now fully display in the method editor, right across the code editing area. In previous versions, long method lines were truncated and ended with an ellipsis.
When the focus is on a method name in the method editor tree, pressing Return or Enter allows the selected method name to be edited (provided that it is editable). Once the method name has been edited you can press Return or Enter to confirm the edit.
Try Studio 8.1.x
If you would like to try out the enhancements in Method Editor in Studio 8.1.1, you can download a free 90-day trial version from here:
To find out more about the Omnis Method Editor, look at the Omnis Programming online manual: