Debugging Starlark with the IntelliJ Plugin
October 16, 2024 ยท View on GitHub
To debug Starlark, you need to create a build run configuration. You can do this in two ways: manually create a new configuration or reuse an existing one.
Method 1: Create a Run Configuration Manually
- Open the Run Configurations menu.
- Click the
+icon to add a new configuration. - Select Bazel Command from the list.
- Enter the target expression in the Target field.
- Set the Bazel Command field to
build.
Method 2: Reuse an Existing Run Configuration
- Run the target using an existing configuration.
- Open the Run Configurations editor.
- Change the Command field to
build. - Run the configuration again.
Important: Before starting the debugger, ensure you have modified something in the Starlark file. If no changes are made, Bazel will use the analysis cache and skip executing the Starlark code.
Demo: Showing Both Methods
https://github.com/user-attachments/assets/959b3d53-f79b-4329-bd3b-74d328af761a