Sidebar

Mobile navigation sidebar

Features

Formatting

Keep SQL and PL/SQL code consistent and readable with the built-in formatter.

Formatting

Nexo SQL Studio includes a SQL/PLSQL formatter that normalises whitespace, indentation, keyword casing, commas, operators, joins, and parameter lists. Apply it on demand or wire it into your VS Code Format on Save workflow.

Formatting a File

  • Keyboard shortcut: Shift+Alt+F (VS Code default)
  • Command palette: Format Document
  • Right-click: Format Document in the editor context menu

Format on Save

Add this to your VS Code workspace settings to format automatically:

// .vscode/settings.json
{
  "editor.formatOnSave": true,
  "[plsql]": {
    "editor.defaultFormatter": "NexoSQLStudio.nexosqlstudio"
  },
  "[sql]": {
    "editor.defaultFormatter": "NexoSQLStudio.nexosqlstudio"
  }
}

Formatter Options

Configure formatting behaviour in your VS Code settings:

SettingDefaultDescription
nexo-sql-studio.formatter.enabletrueEnable the formatter
nexo-sql-studio.formatter.keywordCaseupperupper, lower, or preserve
nexo-sql-studio.formatter.indentSize2Number of spaces per indent level
nexo-sql-studio.formatter.commaStyletrailingComma placement in multi-line lists
nexo-sql-studio.formatter.maxBlankLines1Maximum consecutive blank lines

What Gets Formatted

  • SQL DML (SELECT, INSERT, UPDATE, DELETE, MERGE)
  • DDL (CREATE TABLE, CREATE INDEX, …)
  • PL/SQL blocks (BEGIN … END, IF, LOOP, CASE, …)
  • Package specs and bodies
  • Stored procedures and functions
  • Trigger bodies

Preserving Regions

Wrap any region with --@formatter:off / --@formatter:on comments to skip formatting within that block:

--@formatter:off
-- hand-crafted alignment
SELECT a, b,
       c  FROM t;
--@formatter:on