VS Code extension for conservative PL/SQL formatting with generated-code protection.
The formatter is intentionally cautious:
- generated files are skipped by default
- generated trigger path patterns are skipped
- files with common generated-code markers such as
Generated by or DO NOT EDIT are skipped
- comments and string literals are preserved
- formatting focuses on indentation and small whitespace cleanup
Local Setup
Run this from tools/plsql-formatter-vscode:
npm install
npm test
npm run compile
If the company VPN blocks npm registry access, turn VPN off before running npm install.
VS Code Testing
Open this extension folder in VS Code and press F5 to launch an Extension Development Host.
In the Extension Development Host:
- Open a hand-maintained
.pkb, .pks, .sql, .trg, .prc, or .fnc file.
- Run
PL/SQL Formatter: Format Document.
- Review the diff before saving.
- Open a generated trigger file and verify it is skipped.
Settings
{
"plsqlFormatter.formatOnSave.enabled": false,
"plsqlFormatter.generatedPolicy": "skip",
"plsqlFormatter.indentSize": 2,
"plsqlFormatter.keywordCase": "preserve",
"plsqlFormatter.lintJoinModifier.enabled": true,
"plsqlFormatter.maxLineLength": 120
}
To try format on save for this formatter:
{
"plsqlFormatter.formatOnSave.enabled": true,
"[plsql]": {
"editor.defaultFormatter": "OracleBerkanOzcakir.plsql-format"
}
}
Generated files remain skipped unless plsqlFormatter.generatedPolicy is set to force.