PL/SQL formatter using SQLcl
Inspired by atom-oracle-format and SQLcl – Setting Up the Formatter.
Works with Format Document
, Format Selection
commands and editor.formatOnSave
setting for plsql
and oraclesql
language files.
// (Optional) Executing "sql" from PATH otherwise...
"oracle-format.sqlcl": "/absolute/path/to/sql.exe",
// (Optional) Using default formatter settings otherwise...
"oracle-format.rules": "/absolute/path/to/style.xml"
// (Optional) Change languages associated with formatter
"oracle-format.languages": ["plsql" , "oraclesql"]
To reference a relative path inside your workspace use "${workspaceFolder}" variable:
"oracle-format.rules": "${workspaceFolder}/.vscode/style.xml"
If you are seeing the following warning message in the Developer Tools Console after running "formatOnSave":
WARN Aborted format on save after 750ms
then you need to increase the VS Code default timeout option as formatting can take quite some time for larger files:
"editor.formatOnSaveTimeout": 10000
- Oracle SQLcl
- Language PL/SQL or Oracle Developer Tools for VS Code
The output from SQLcl command is printed to Output channel ("oracle-format").