Back to VS Code home
You can use the commands below when editing Ballerina code via the VS Code extension.
Click View in the menu bar of the editor, and then, click Command Palette to access them.
Tip: Alternatively, you can press
Ctrl
+Shift
+P
on Windows and Linux or⌘
+shift
+P
on Mac to open the Command Palette.
Command | Description |
---|---|
Show Examples | Lists the available examples of the Ballerina language. Click on each example to explore them. |
Build | Provides quick access to build your Ballerina project. Once executed, the current Ballerina project relative to the currently-opened text editor is built using the bal build CLI command. |
Pack | Provides quick access to pack your Ballerina library packages. Once executed, the current Ballerina project relative to the currently-opened text editor is packed using the bal pack CLI command. |
Run | Runs your Ballerina project. Once executed, the opened Ballerina project is built using the bal run CLI command. |
Test | Runs all the tests in your Ballerina project using the bal test CLI command. |
Build Documentation | Provides a quick guide to generate documentation for your Ballerina project. Once executed, the documentation is generated using the bal doc CLI command. The generated documentation can be found inside the apidocs directory in the target project. |
Show Diagram | Provides a palette reference to access the Diagrams. On execution, the diagram editor of the first diagram component listed under the Diagrams view is rendered. |
Add Module | Adds a Ballerina module for the given module name using the bal add CLI command. |
Create 'Cloud.toml' | Generates a Cloud.toml file for your Ballerina project according to the default cloud specifications. |
Paste JSON as Record | Converts a JSON string (that is copied to the clipboard) to a Ballerina record(s) and pastes it in your code. |