Source code completion

Purpose of source code completer

The fglcomp compiler has a build-in feature to make source code completion. For example, if you start to type FUNC then press the TAB key, the code will be completed with the FUNCTION keyword.

Source code completion is integrated in the Genero Studio code editor. To use this feature with another code editor (like VIM), the text editor must be configured to call fglcomp with options with shortcuts and get code completion proposals. For more details about VIM configuration, see Configure VIM for Genero BDL.

Complete column and variable names in static SQL

When editing static SQL statements, code completion proposes available symbols for program variables, SQL tables and columns (from the schema file).

Column proposals after customer table name:

SCHEMA stores
MAIN
    DEFINE cust_id INTEGER
    DEFINE rec RECORD LIKE customer.*
    SELECT * INTO rec.* FROM customer
     WHERE customer.address1
                  | address1     c VARCHAR(20)   |
                  | address2     c VARCHAR(20)   |
                  | city         c VARCHAR(15)   |
                  | company      c VARCHAR(20)   |
                  | customer_num c INTEGER       |
                   ...     
Variable proposals after $ sign:
SCHEMA stores
MAIN
    DEFINE cust_id INTEGER
    DEFINE rec RECORD LIKE customer.*
    SELECT * INTO rec.* FROM customer
     WHERE customer.customer_num = $<TAB>
                                  | cust_id   v INTEGER              |
                                  | int_flag  v INTEGER              |
                                  | quit_flag v INTEGER              |
                                  | rec       v like:stores.customer | 
                                    ...