OpenEdge ABL Formatter [](https://github.com/BalticAmadeus/AblFormatter/actions/workflows/main.yml)

March 19, 2026 ยท View on GitHub

VSCode extension for Progress OpenEdge ABL code formatting.

This extension uses tree-sitter-abl implementation.

Current status

The OpenEdge ABL Formatter is now available in the VS Code Extension Marketplace.

Note:

  1. We currently recommend not using the formatter with the on save trigger.
  2. Use formatting cautiously, especially when working with existing code that is difficult to test.

Formatter in action

Features

At the moment we implemented formatting logic for these language features:

  • Assign
  • block
  • body
  • case
  • enum
  • find
  • for
  • functionParameter
  • if
  • ifFunction
  • procedureParameter
  • property
  • tempTable
  • using
  • variableDefinition

Installation

Download the extension from VSCode Marketplace and install on your machine. There are no additional dependencies needed to launch this extension.

Configuration and Setup

We implemented extensive settings configuration to allow users to easily tailor the experience to their needs. This might not be the case in the future. You can access the settings via VS Code settings or clicking ABL Formatter icon at the far right of an ABL files editor title bar. You can also access settings UI via the Command Palette (Ctrl+Shift+P) by typing "Formatter Settings Preview"

Settings

Property NameTypeDefaultValues listDescription
assign formattingbooleantruetrue, falseEnable/disable ASSIGN statement formatting.
assign formatting assign locationstringNewNew, SameShould first assignment be located on a new line or the same line as the ASSIGN keyword
assign formatting align right expressionstringYesYes, NoShould right expression be aligned by longest one
assign formatting end dot locationstringNew alignedNew, New aligned, SameShould end dot be located on a new line or the same line as the ASSIGN keyword
find formattingbooleantruetrue,falseEnable FIND formatting
for formattingbooleantruetrue,falseEnable FOR formatting
case formattingbooleantruetrue,falseEnable CASE formatting
case formatting then locationstringSameNew, SameShould THEN clause be on a new line or the same line as the CASE keyword?
case formatting do locationstringSameNew, SameShould DO block be on a new line or the same line as the THEN keyword
case formatting statement locationstringNewNew, SameShould the first statement in a WHEN block be on a new line or the same line
block formattingbooleantruetrue,falseEnable block formatting
if formattingbooleantruetrue,falseEnable IF formatting
if formatting then locationstringSameNew, SameShould THEN clause be on a new line or the same line as the IF keyword
if formatting do locationstringSameNew, SameShould DO block be on a new line or the same line as the THEN keyword
if formatting statement locationstringSameNew, SameShould the first statement in an IF block be on a new line or the same line
temptable formattingbooleantruetrue,falseEnable TEMP-TABLE formatting
temptable formatting end dot locationstringSameNew, SameShould end dot be located on a new line or the same line as the last TEMP-TABLE line
using formattingbooleantruetrue,falseEnable USING formatting
using formatting from propathstringDoNothingDoNothing, add, removeShould 'from propath' be added or removed in USING statements automatically
body formattingbooleantruetrue,falseEnable BODY formatting
property formattingbooleantruetrue,falseEnable property formatting
if function formattingbooleantruetrue,falseEnable IF FUNCTION formatting
if function formatting add parenthesesstringNoYes, NoAdd parentheses around the expression
if function formatting else locationstringSameNew, SameShould ELSE clause be on a new line or the same line as the IF FUNCTION keyword
enum formattingbooleantruetrue,falseEnable ENUM formatting
enum formatting end dot locationstringSameNew, SameShould end dot be located on a new line or the same line
variable definition formattingbooleantruetrue,falseEnable DEFINE VARIABLE formatting
procedure parameter formattingbooleantruetrue,falseEnable PROCEDURE PARAMETER formatting
function parameter formattingbooleantruetrue,falseEnable FUNCTION PARAMETER formatting
function parameter formatting align parameter typesstringYesYes, NoAlign parameter types
array access formattingbooleantruetrue,falseEnable ARRAY ACCESS formatting
array access formatting add space after commastringYesYes, NoAdd space after comma
expression formattingbooleantruetrue,falseEnable EXPRESSION formatting
expression formatting logical locationstringNewNew, SameShould logical operators be on a new line or the same line as the expression
statement formattingbooleantruetrue,falseEnable STATEMENT formatting
show tree info on hoverbooleantruetrue,falseEnable table view with tree info on hover

Usage

Use default VSCode formatting commands:

  • Format Document: Formats the entire ABL document. SHIFT+ALT+F
  • Format Selection: Formats only the selected lines of code. CTRL+K CTRL+F

Also, you can enable or disable formatting on save:

"editor.formatOnSave": true

Allowed file extensions:

  • .p
  • .cls
  • .i
  • .w

Overriding Settings:

For development reasons, we implemented a mechanism to override formatting settings for a specific file. You can also use this feature by adding a leading comment in your code file:

Example:

/* formatterSettingsOverride */
/* {
"AblFormatter.blockFormatting": true,
"AblFormatter.assignFormatting": true
} */
def var a as integer no-undo init 1.

repeat while true:
    assign
    a = 10.
    message a.
end.

For more examples you can check out our test directory

Debugging

We implemented debug mode for looking into tree-sitter issues. You can also enable it:

  1. First you have to format the document.
  2. Then you can enable debug mode by pressing Abl Formater button in the Status Bar.
  3. Hover on highlighted parts of code to get more information and see the tree view.

Debug Mode

How to View Diff Between Preformatted and Formatted ABL Code Files in VSCode

Precondition: Disable VS Code auto save.

  1. Open the file you want to format.
  2. Open the Command Palette (Ctrl+Shift+P).
  3. Run "Compare Active File with Saved".
  4. In the right view format document or format selection.
  5. Check the diffs.
  6. If everything is OK, save the file (Ctrl+S). Otherwise return/undo (Ctrl+Z).

Contributing

If you wish to contribute, see our guidelines here.

License

This project is licensed under the APACHE 2.0 License - see the LICENSE file for details.

BA