IFX FormatFormats Informix SPL and Informix 4GL in Cursor and VS Code without overriding generic SQL formatters (Postgres, etc.). ID:
FeaturesInformix SPL (
|
| Extension | Language ID | Formatter |
|---|---|---|
.ifs, .ifx, .spl |
informix-spl |
IFX Format (SPL) |
.4gl |
informix-4gl |
IFX Format (4GL) |
.sql |
sql |
Your usual formatters |
For Informix-only projects, associate .sql in the workspace:
{
"files.associations": {
"*.sql": "informix-spl"
}
}
Usage
- Open a
.ifs,.ifx,.spl, or.4glfile - Format Document (
Shift+Alt+F) or enable format on save - Or run IFX Format: Format Document
Snippets
In an Informix file, type the prefix and accept the suggestion (Enter / Tab):
| Language | Prefix | Inserts |
|---|---|---|
| SPL/4GL | header / encabezado |
Module header (description, version, …) |
| SPL | procedure / proc |
DROP + CREATE PROCEDURE skeleton |
| 4GL | main / main4gl |
DATABASE + MAIN / END MAIN |
| 4GL | function / func |
FUNCTION / END FUNCTION skeleton |
Example (SPL)
Before
create procedure sp_demo(p_id int)
returning int;
define l_total int;
if p_id > 0 then
let l_total = p_id * 2;
else
let l_total = 0;
end if;
return l_total;
end procedure;
After
CREATE PROCEDURE sp_demo(p_id INT)
RETURNING INT;
DEFINE l_total INT;
IF p_id > 0 THEN
LET l_total = p_id * 2;
ELSE
LET l_total = 0;
END IF;
RETURN l_total;
END PROCEDURE;
Settings
Shared
| Setting | Default | Description |
|---|---|---|
ifxFormat.customFileIcons |
true |
Show custom IFX icons for .spl / .ifs / .ifx / .4gl. When off and Material Icon Theme is installed, those extensions use the generic file icon. VS Code cannot remove language icons without an icon-theme override. |
SPL formatting (ifxFormat.*)
| Setting | Default | Description |
|---|---|---|
ifxFormat.uppercase |
true |
Uppercase keywords |
ifxFormat.indentSize |
2 |
Spaces per indent level |
ifxFormat.useTabs |
false |
Use tabs instead of spaces |
ifxFormat.blankAfterQuery |
true |
Blank line after queries (also after FOREACH cursor SELECT) |
ifxFormat.blankAfterIf |
true |
Blank after IF / ELSE / END IF / END FOR / END FOREACH / END WHILE |
ifxFormat.blankAfterReturning |
true |
Blank line after RETURNING |
ifxFormat.blankBeforeElseEndIf |
true |
Blank line before ELSE / END IF |
ifxFormat.blankBeforeException |
true |
Blank line before ON EXCEPTION / END EXCEPTION |
ifxFormat.blankAfterException |
true |
Blank line after ON EXCEPTION / END EXCEPTION |
ifxFormat.keepEndClosersTogether |
true |
No blank lines between stacked closers |
ifxFormat.spaceBeforeCreateTableParen |
true |
Space before ( in CREATE [TEMP] TABLE name ( |
ifxFormat.blankAroundDropTable |
true |
Group consecutive DROP TABLE; blank above/below |
ifxFormat.blankAfterCreateTable |
true |
Blank line after CREATE [TEMP] TABLE ...; |
4GL formatting (ifxFormat.4gl.*)
| Setting | Default | Description |
|---|---|---|
ifxFormat.4gl.uppercase |
true |
Uppercase 4GL keywords |
ifxFormat.4gl.indentSize |
2 |
Spaces per indent (MAIN / FUNCTION / IF / …) |
ifxFormat.4gl.useTabs |
false |
Use tabs instead of spaces |
ifxFormat.4gl.blankAfterIf |
true |
Blank after IF / ELSE / END IF / loops |
ifxFormat.4gl.blankBeforeElseEndIf |
true |
Blank before ELSE / END IF |
ifxFormat.4gl.blankBeforeBlock |
true |
Blank before MAIN / FUNCTION and their END |
ifxFormat.4gl.blankAfterBlock |
true |
Blank after MAIN / FUNCTION and their END |
ifxFormat.4gl.keepEndClosersTogether |
true |
No blank lines between stacked closers |
Syntax highlighting (SPL + 4GL)
| Setting | Default | Description |
|---|---|---|
ifxFormat.syntax.highlightVariables |
true |
Color parameters, locals, 4GL functions/builtins |
ifxFormat.syntax.parameterColor |
#FBBF24 |
Parameter color |
ifxFormat.syntax.localColor |
#2DD4BF |
Local / DEFINE / ON EXCEPTION SET color |
ifxFormat.syntax.functionColor |
#E5C07B |
Local 4GL function names (declaration + CALL) |
ifxFormat.syntax.builtinColor |
#56B6C2 |
4GL builtins (num_args, ARG_VAL, …) |
ifxFormat.syntax.highlightControl |
true |
Control keywords match their END color |
ifxFormat.syntax.controlIfColor |
#C792EA |
IF / ELSE / END IF (also MAIN in 4GL) |
ifxFormat.syntax.controlForColor |
#82AAFF |
FOR / END FOR (also FUNCTION keyword in 4GL) |
ifxFormat.syntax.controlForeachColor |
#82AAFF |
FOREACH / END FOREACH |
ifxFormat.syntax.controlWhileColor |
#82AAFF |
WHILE / END WHILE |
ifxFormat.syntax.controlExceptionColor |
#FF5370 |
ON EXCEPTION / END EXCEPTION |
Requirements
Cursor or VS Code >= 1.74
Links
License
MIT


