Skip to content

mickeypearce/vscode-oracle-format

Repository files navigation

oracle-format

PL/SQL formatter using SQLcl

Inspired by atom-oracle-format and SQLcl – Setting Up the Formatter.

Usage

Works with Format Document, Format Selection commands and editor.formatOnSave setting for plsql and oraclesql language files.

Configuration

// (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"

Format on Save

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

Prerequisites

Note

The output from SQLcl command is printed to Output channel ("oracle-format").