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 can be enabled in the VIM editor and in VS Code: The 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 and Visual Studio Code extension.
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 |
...