AMDP Pretty Printer – VS Code ExtensionFormats ABAP Managed Database Procedure (AMDP / SQLScript) source code by using the AMDP Pretty Printer core engine (Java)
Requirements
Features
Usage
SettingsAll settings are under the
|
| Value | Behaviour |
|---|---|
0 |
Always insert a line break after a comma |
1 |
Never insert a line break after a comma |
2 |
Depends on the closing bracket |
3 |
Depends on the closing bracket and sub-functions |
4 (default) |
Depends on the closing bracket, sub-functions, and keywords |
Type: number · Default: 4
amdp-pretty-printer.javaPath
Path to the Java 21+ executable used to run the formatter JAR.
Set this if java is not on your system PATH or if you want to use a specific JRE/JDK installation.
You must escape the '' with '\'
Type: string · Default: "java"
Example:
"amdp-pretty-printer.javaPath": "C:\\Program Files\\Java\\jdk-21\\bin\\java.exe"
You can also use the JRE that is shipped with Eclipse. Just search in the Eclipse plugins folder for the java.exe.
The path depends on your Eclipse version.
Example:
"amdp-pretty-printer.javaPath": "C:\\eclipse\\plugins\\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.10.v20260205-0638\\jre\\bin\\java.exe"
amdp-pretty-printer.trace
Passes the --trace flag to the formatter process, which causes it to write additional diagnostic output to stderr. Useful for debugging unexpected formatting results.
Type: boolean · Default: false
How It Works
The extension spawns the AMDP Pretty Printer fat-JAR as a child process and communicates with it via stdin / stdout:
- The full document text is written to the process's stdin.
- The formatted text is read back from stdout.
- If the output differs from the input, VS Code's text-editing API replaces the entire document content.
The process is given a 30-second timeout. If the JAR does not respond within that window the child process is killed and an error message is shown.
Troubleshooting
| Problem | Solution |
|---|---|
| "Failed to start Java process" / ENOENT | Java is not on your PATH. Set amdp-pretty-printer.javaPath to the full path of your java executable. |
| "Timed out after 30 s" | The input is unusually large or Java startup is slow. Enable amdp-pretty-printer.trace and check the output for hints. |
Formatter is not triggered by Shift+Alt+F |
VS Code may be using a different default formatter. Open the Command Palette and run Format Document With…, then select AMDP Pretty Printer. |
Plugin for Eclipse
The plugin is also available for Eclipse.
See https://github.com/fmabap/AMDP_Pretty_Printer for details.
License
MIT – see LICENSE.
