A Visual Studio Code extension designed to automatically format your Robot Framework code. This extension aligns keywords and arguments in a structured, readable format, ensuring consistency across your Robot Framework test suites.
Features
- Auto-Format Robot Framework code: Automatically formats Robot Framework code for better readability.
- Aligns keywords: The extension aligns keywords, arguments, and variables neatly, making your code more readable.
- Support for custom formatting: The extension applies specific rules to space out keywords, arguments, and lines according to your preferences.
- Clean formatting: Keeps a consistent style for all Robot Framework files, reducing manual formatting effort.
Installation
To install the Robot Framework Smart Formatter extension:
- Open Visual Studio Code.
- Go to the Extensions panel (
Ctrl+Shift+X
).
- Search for Robot Framework Smart Formatter.
- Click Install.
Alternatively, you can install it from the VS Code Marketplace:
Robot Framework Smart Formatter on Marketplace
Usage
- Open a Robot Framework test suite file (
.robot
).
- To format the document:
- Use the keyboard shortcut
Alt+Shift+F
.
- Or, right-click inside the document and select Format Document.
The extension will automatically format your code by aligning the keywords, arguments, and ensuring consistent spacing.
Settings
The extension comes with the following settings:
- Tab alignment: Aligns keywords and arguments with configurable tab spaces.
- Line breaks: The extension ensures clean line breaks after certain keywords.
- Customizable spacing: Adjust how many tab spaces or spaces between arguments are applied.
You can customize these settings in the VS Code settings JSON file.
Example configuration:
"robotSmartFormatter.tabSpaceCount": 8,
"robotSmartFormatter.alignColumns": true,