Homemade formatter for AQL file. AQL is a query language for ArangoDB.
-
Install Typescript annd TS-Node globally
npm install -g typescript npm install -g ts-node -
Install an extension to allow custom scripts in VS Code. I use Custom Local Formatters.
-
Update the config file of the extension to point to the formatter.ts file.
"customLocalFormatters.formatters": [ { "command": "ts-node path/to/formatter.ts", "languages": [ "aql" ] } ],
-
When formatting an AQL file, the script will be executed and the file will be formatted.
The script reads the input from stdin, formats it and writes the output to stdout.
- Capitalize the functions and keywords
- Replace double whitespaces with a single whitespace
- Space after a comma