Commands

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 use the ⌘ + ↑ + P shortcut methods on Mac and Ctrl + Shift + P on Windows and Linux to open the Command Palette.

CommandDescription
Show ExamplesLists the available examples of the Ballerina language. Click on each example to explore them.
BuildProvides 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.
PackProvides 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.
RunRuns your Ballerina project. Once executed, the opened Ballerina project is built using the bal run CLI command.
TestRuns all the tests in your Ballerina project using the bal test CLI command.
Build DocumentationProvides 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 apidocsdirectory in the target project.
Show DiagramProvides 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 ModuleAdds a Ballerina module for the given module name using the bal addCLI command.
Create 'Cloud.toml'Generates a Cloud.toml file for your Ballerina project according to the default cloud specifications.
Paste JSON as RecordConverts a JSON string (that is copied to the clipboard) to a Ballerina record(s) and pastes it in your code.