With OmniCode, when editing CSS content, be it in .css files or
<style> bags, you essentially get autocompletion for the entire Sciter's specific CSS map, which is documented here.
CTRL+Space programming is how I consider the crazy way a programmer ends up coding, specifically when working with a statically typed language (like C++, C#, Java) and a good IDE.
Essentially it is all about autocompletion, about having the IDE telling what is available in the context where you are typing:
So the benefits of autocompletion are many, so I don't think I need to explain the importance of it for beeing a productive programmer.
Well, TIScript is a dynamic typed language, so you can't know the type of a variable with static analysis. That was a big challenge I faced when developing OmniCode and it's Intellisense support.
I had to resort to some smart ways to discover the type of variables and calls for known API methods so I can show you their signature and needed parameters.
There are 3 methods you should know that OmniCode uses to give you autocompletion where possible:
OmniCode infers the type of a given variable based on its name. That is, you programmer, by following a convention in naming your variables, is helping OmniCode to know the type of variables.
As in the following GIF, by naming the variable as
el_div, it is inferred its type as Element, because of the
Notice that identifiers with inferred type have a distinctive grayed color.
This way, when you type a dot, OmniCode can show the methods/properties available for
Element class, or for whatever type which was inferred, as
Graphic for variables named
All the rules for these naming conventions are available here: conventions table.
When you are typing the following code, OmniCode correctly shows the completion-list of methods/properties available:
The following analysis is made:
self#menu-cfgis automatically inferred as
Elementtype (it's a way in TISript that to get an
Elementreference by its ID)
$is a valid method of the
Elementclass and it returns an
Element, we know the names available, and as you already started typing
ht, the list is filtered to show only names containing
All this is possible because OmniCode contains a database of all TIScript built-in API, that is, all methods/properties/constants of classes/types you find in Sciter documentation.
So with this analysis of statements, you have not just autocompletion lists, but all features of a good Intellisense experience:
Signature help - shows method prototype (and overrides) and highlights the current argument being typed
QuickInfo - show details about the name under cursor
OmniCode keeps track, at real-time, of all user-defined symbols/names, so you get autocompletion for your own code:
That is, after you type any TIScript code, the file is parsed, and declarations of variables, consts, functions, classes and namespaces are extracted.
import "xyz.tis" statements will trigger scanning of the imported file.
This database of locations of every user-defined symbols makes possible the GoToDefinition functionality, that is, allows you to, for example, press F12 in a function call statement and navigate to where the function is defined.
Another clever autocompletion support is presented after you type
It shows all ID available from your HTML markup:
The database of IDs is built from open HTML files. That is, make sure to open all HTML files that you want to have its DOM tree parsed and IDs extracted.
Pressing F12 in a
self#myElementID expression opens the location of the tag/element in your HTML markup with the given ID, if it exists.
Next post I will show how do CTRL+Space programming in CSS, stay tunned.
For Chinese users, Omni 2.5 and OmniCode 2.6 bring fixes to the licensing system so I think now you will be able to 'Start' your trial period.
If you've already spent your 15 trial period, use the following keys to register for another 7 days trial (make sure to download the lastest version of these tools):