Debugging
How to debug BoxLang applications in IntelliJ IDEA — breakpoints, stepping, variable inspection, watch expressions, and expression evaluation.
The BoxLang IntelliJ plugin provides full debugging support through the Debug Adapter Protocol (DAP). Debug BoxLang scripts with breakpoints, stepping, variable inspection, and expression evaluation.
Starting a Debug Session
Method 1: Debug from Gutter Icon
Open a BoxLang file
Click the green play icon ▶️ in the gutter
Select Debug 'filename'
Method 2: Debug from Run Configuration
Create or select a BoxLang run configuration
Click the Debug button (🐛) in the toolbar
Or press Shift+F9
Method 3: Debug from Context Menu
Right-click a BoxLang file in the Project view
Select Debug 'filename'
Breakpoints
Setting Breakpoints
Click in the gutter next to a line number to set a breakpoint. A red dot appears.
Keyboard shortcut: Place cursor on the line and press Cmd+F8 (Mac) or Ctrl+F8 (Windows/Linux).
Breakpoint Types
Line Breakpoint
Pauses execution at a specific line
Conditional Breakpoint
Pauses only when a condition is true
Logpoint
Logs a message without pausing execution
Conditional Breakpoints
Right-click the breakpoint dot
Enter a condition in the Condition field
The breakpoint only triggers when the condition evaluates to
true
Example conditions:
Logpoints
Right-click the breakpoint dot
Check Log evaluated message
Enter a message with expressions in
{}Uncheck Suspend thread to continue execution
Example log message:
Debug Toolbar
When paused at a breakpoint, use the debug toolbar to control execution:
Resume
F9
Continue execution until next breakpoint
Pause
(none)
Pause execution at current line
Stop
Cmd+F2 / Ctrl+F2
Terminate the debug session
Step Over
F8
Execute current line, skip into functions
Step Into
F7
Step into function calls
Step Out
Shift+F8
Execute to end of current function
Run to Cursor
Alt+F9
Execute to cursor position
Drop Frame
(none)
Pop current stack frame and re-execute
Variable Inspection
Variables Panel
The Variables panel shows all variables in the current scope:
Local variables — Variables in the current function
Arguments — Function parameters
This — Current object instance
Closure scope — Variables captured by closures
Click the arrow next to a variable to expand nested values (structs, arrays, objects).
Hover Inspection
Hover over any variable in the editor while paused to see its current value in a tooltip.
Inline Values
Enable inline values in Settings → Build, Execution, Deployment → Debugger → Async Stack Traces:
Check Show variable values in editor
Variables display their values inline next to their declarations
Watch Expressions
Add custom expressions to monitor during debugging:
Open the Watches panel (usually on the right side of Variables)
Click the + button
Enter an expression (e.g.,
user.email,arrayLen(items))The expression evaluates and updates on each pause
Quick Evaluate
Select an expression in the editor and press Alt+F8 (Option+F8 on Mac) to evaluate it immediately.
Expression Evaluation
Debug Console (REPL)
The Debug Console provides a REPL (Read-Eval-Print Loop) for evaluating BoxLang expressions:
Open the Debug Console tab at the bottom
Type any BoxLang expression
Press Enter to evaluate
Examples:
Evaluate Expression Dialog
Press Alt+F8 (Option+F8 on Mac)
Enter an expression in the dialog
Click Evaluate to see the result
Stack Frames
The Frames panel shows the call stack:
Click a frame to switch to that context
Variables update to show the selected frame's scope
Double-click a frame to navigate to the source code
Async Stack Traces
For asynchronous code (futures, callbacks), enable async stack traces:
Settings → Build, Execution, Deployment → Debugger → Async Stack Traces
Check Capture async stack traces
Attach Debugging
Connect to a running BoxLang process:
Create a BoxLang Attach run configuration
Configure host, port, and path mappings
Click Debug
See Run Configurations for details.
Debugging Tips
Conditional Breakpoints for Loops
Watch for State Changes
Add a watch expression that changes:
Use Logpoints for Tracing
Instead of adding writeDump() calls, use logpoints:
Evaluate Complex Expressions
Related Pages
Last updated
Was this helpful?