Code completion

To make text input on iOS easier and faster Shaderific now provides code completion.

Code completion works in a unix-like style and can be invoked by pressing the tab key when the cursor is at the end of an incomplete word. If there is only one completion result the word is auto-completed instantly. In case of more than one result the word is completed as far as possible and all possible completions are shown in a popover list view. You can now select an entry from the list to complete the word or just continue typing. In the latter case the popover is dismissed automatically.

The completion results are sorted by the following categories:

The section Variables includes the built-in variables of the OpenGL Shading Language as well as user-defined variables and functions. All variables and functions that have been declared by the user are added to the list of possible word completions automatically.

Side note: The popover list view is only available on the iPad. Everything else works the same way on iPhone and iPad. Since there is no tab key available on the standard keyboard of the iPhone, code completion can only be used when the device is paired with a (bluetooth) hardware keyboard.