Run and Debug

The VS Code Ballerina extension gives you the same debugging experience as the conventional VS Code Debugger. Thus, you can run or debug your Ballerina programs easily via the VS Code Ballerina extension by launching its debugger.

Starting a Debug Session

Follow the steps below to start a debug session.

  1. Click the Debug icon in the left menu or press the Control + Shift + D keys, to launch the Debugger view.
  2. Add the debug points you require by clicking on the respective line numbers of the file.
  3. Click No Configurations and select Add Configuration….
  4. Click Ballerina Debug. This opens the launch.json file. You can edit this file to change the debug configuration options as required.
  5. Click on the name of the file that you want to debug.
  6. Click the Start Debugging icon.

You view the output in the DEBUG CONSOLE.

Run and debug

For more information on debugging your code using VS Code, go to VS Code Documentation.


  • Stepping over code lines in non-blocking paths (eg: action invocations) will not pause VM on the next line
    • workaround: manually put a breakpoint to the next line
  • There are some cases where stepping over gives unexpected behavior
    • E.g., when there are multiple workers and a wait expression waiting for them, even though it steps over to hit and pass the wait line in the source, the workers may not have finished the execution yet.

What’s Next?