Features
Debugging
Master CodeNest's powerful debugging tools to identify and fix issues in your code efficiently.
Getting Started with Debugging
CodeNest provides a comprehensive debugging experience with breakpoints, variable inspection, call stack analysis, and step-through debugging for multiple languages.
Setting Up Debug Configuration
- Open your project in CodeNest
- Go to Run and Debug view (Ctrl+Shift+D)
- Click "create a launch.json file"
- Select your environment (Node.js, Python, etc.)
Breakpoints
Setting Breakpoints
- Click in the gutter next to line numbers
- Use F9 to toggle breakpoints
- Right-click for conditional breakpoints
Types of Breakpoints
- Line Breakpoints - Stop at specific lines
- Conditional Breakpoints - Stop when condition is true
- Hit Count Breakpoints - Stop after N hits
- Function Breakpoints - Stop when function is called
Debug Controls
Execution Controls
| Action | Shortcut | Description |
|---|---|---|
| Continue | F5 | Resume execution |
| Step Over | F10 | Execute next line |
| Step Into | F11 | Step into function calls |
| Step Out | Shift+F11 | Step out of current function |
| Restart | Ctrl+Shift+F5 | Restart debugging session |
| Stop | Shift+F5 | Stop debugging |
Variable Inspection
Variables Panel
The Variables panel shows:
- Local variables in current scope
- Global variables
- Closure variables
- Object properties and array elements
Watch Expressions
Monitor specific expressions:
- Open the Watch panel
- Click the "+" button
- Enter the expression to watch
- Values update as you debug
Call Stack
The Call Stack panel shows:
- Current execution path
- Function call hierarchy
- Click frames to navigate
- View local variables for each frame
Debug Console
Use the Debug Console to:
- Evaluate expressions in current context
- Execute commands during debugging
- View debug output and logs
- Interact with your application
Language-Specific Debugging
JavaScript/Node.js
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/app.js",
"console": "integratedTerminal"
}Python
{
"type": "python",
"request": "launch",
"name": "Python: Current File",
"program": "${file}",
"console": "integratedTerminal"
}Java
{
"type": "java",
"request": "launch",
"name": "Launch Java Program",
"mainClass": "Main",
"classPaths": ["${workspaceFolder}"]
}Remote Debugging
Attach to Process
- Start your application with debug flags
- Create attach configuration in launch.json
- Use "Attach to Process" from debug menu
- Select the target process
Remote Server Debugging
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "localhost",
"port": 9229
}Advanced Features
Multi-target Debugging
Debug multiple processes simultaneously:
- Configure multiple launch configurations
- Use compound configurations
- Switch between debug sessions
Exception Handling
Configure exception breakpoints:
- Break on all exceptions
- Break on uncaught exceptions only
- Filter by exception type
Debugging Tips
Best Practices
- Use meaningful variable names for easier inspection
- Set conditional breakpoints to avoid noise
- Use the debug console for quick tests
- Leverage watch expressions for complex conditions
Performance Debugging
- Use profiling tools for performance issues
- Monitor memory usage in variables panel
- Check call stack for performance bottlenecks
Troubleshooting
Common Issues
- Breakpoints not hit - Check source maps and file paths
- Variables not showing - Ensure debug symbols are available
- Slow debugging - Reduce number of watch expressions
Debug Configuration Problems
- Verify launch.json syntax
- Check file paths and working directory
- Ensure required extensions are installed