|
1 | | -# luceedebug VS Code Extension |
| 1 | +# luceedebug - CFML Step Debugger for Lucee |
2 | 2 |
|
3 | | -VS Code debugger extension for luceedebug, enabling breakpoints for {.cfm,.cfc,.cfml} files. |
| 3 | +Set breakpoints, inspect variables, and step through CFML code in VS Code. |
4 | 4 |
|
5 | | -For setup instructions, see the main repository: [lucee/extension-debugger](https://github.com/lucee/extension-debugger) |
| 5 | + |
| 6 | + |
| 7 | +## Quick Start |
| 8 | + |
| 9 | +1. Install this extension from the VS Code Marketplace |
| 10 | +2. Set up the debugger on your Lucee server (see [Server Setup](#server-setup)) |
| 11 | +3. Add a debug configuration to `.vscode/launch.json`: |
| 12 | + |
| 13 | +```json |
| 14 | +{ |
| 15 | + "type": "cfml", |
| 16 | + "request": "attach", |
| 17 | + "name": "Lucee Debugger", |
| 18 | + "hostName": "localhost", |
| 19 | + "port": 10000, |
| 20 | + "secret": "your-secret-here" |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +4. Start debugging (F5) |
| 25 | + |
| 26 | +## Server Setup |
| 27 | + |
| 28 | +The debugger server runs on your Lucee instance. There are two modes depending on your Lucee version: |
| 29 | + |
| 30 | +### Lucee Extension (Recommended, Lucee 7.1+) |
| 31 | + |
| 32 | +Install the `.lex` extension via Lucee Admin or deploy it to your extensions folder, then set environment variables: |
| 33 | + |
| 34 | +```bash |
| 35 | +LUCEE_DAP_SECRET=your-secret-here |
| 36 | +LUCEE_DAP_PORT=10000 |
| 37 | +``` |
| 38 | + |
| 39 | +### Java Agent (Lucee 6.x / 7.0) |
| 40 | + |
| 41 | +For older Lucee versions, luceedebug runs as a Java agent with JDWP. See the [Java Agent docs](https://github.com/lucee/extension-debugger/blob/main/JAVA_AGENT.md) for setup instructions. |
| 42 | + |
| 43 | +## Configuration Options |
| 44 | + |
| 45 | +| Option | Description | |
| 46 | +|--------|-------------| |
| 47 | +| `hostName` | DAP server host (required) | |
| 48 | +| `port` | DAP server port (default: 10000) | |
| 49 | +| `secret` | Authentication secret (must match `LUCEE_DAP_SECRET` on server) | |
| 50 | +| `pathTransforms` | Map IDE paths to server paths (see [Path Transforms](#path-transforms)) | |
| 51 | +| `pathSeparator` | Path normalization: `auto` (default), `none`, `posix`, `windows` | |
| 52 | +| `evaluation` | Enable expression evaluation in console/watch/hover (default: true) | |
| 53 | +| `consoleOutput` | Stream console output to debug console (extension mode only, default: false) | |
| 54 | +| `logExceptions` | Log exceptions to the debug console (default: false) | |
| 55 | +| `logLevel` | Log verbosity: `error`, `info`, `debug` (default: info) | |
| 56 | +| `logColor` | Enable ANSI colors in debug log output (default: true) | |
| 57 | + |
| 58 | +## Path Transforms |
| 59 | + |
| 60 | +`pathTransforms` maps between IDE paths and Lucee server paths. This is needed when your IDE sees files at different paths than Lucee does (e.g. Docker containers, remote servers). |
| 61 | + |
| 62 | +For local debugging without containers, you may not need this. |
| 63 | + |
| 64 | +Example for Docker: |
| 65 | + |
| 66 | +```json |
| 67 | +"pathTransforms": [ |
| 68 | + { |
| 69 | + "idePrefix": "/Users/dev/myproject", |
| 70 | + "serverPrefix": "/var/www" |
| 71 | + } |
| 72 | +] |
| 73 | +``` |
| 74 | + |
| 75 | +Multiple transforms can be specified - first match wins. Order from most specific to least specific. |
| 76 | + |
| 77 | +## Features |
| 78 | + |
| 79 | +### Breakpoints |
| 80 | + |
| 81 | +Line breakpoints, conditional breakpoints, function breakpoints (extension mode), and exception breakpoints (extension mode). |
| 82 | + |
| 83 | +### Variable Inspection |
| 84 | + |
| 85 | +Inspect all scopes - local, arguments, variables, request, session, application, and more. |
| 86 | + |
| 87 | +### writeDump / serializeJSON |
| 88 | + |
| 89 | +Right-click on a variable in the debug pane to get `writeDump(x)` or `serializeJSON(x)` output in an editor tab. |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +### Watch Expressions |
| 94 | + |
| 95 | +Support for watch expressions and REPL evaluation in the debug console. |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +**Notes:** |
| 100 | + |
| 101 | +- Conditional breakpoints evaluate to "false" if they fail (not convertible to boolean, or throw an exception) |
| 102 | +- `x = 42` (assignment) vs `x == 42` (equality check) - be careful in conditions! |
| 103 | +- Watch/REPL evaluation that triggers additional breakpoints may cause deadlocks |
| 104 | + |
| 105 | +### Debug Breakpoint Bindings |
| 106 | + |
| 107 | +If breakpoints aren't binding, open the command palette and run **"luceedebug: show class and breakpoint info"** to inspect what's happening. |
| 108 | + |
| 109 | +## Capabilities |
| 110 | + |
| 111 | +| Feature | Extension (7.1+) | Agent (6.x/7.0) | |
| 112 | +|---------|:---------:|:-----:| |
| 113 | +| Line breakpoints | Yes | Yes | |
| 114 | +| Conditional breakpoints | Yes | Yes | |
| 115 | +| Function breakpoints | Yes | No | |
| 116 | +| Exception breakpoints | Yes | No | |
| 117 | +| Step in/out/over | Yes | Yes | |
| 118 | +| Variable inspection | Yes | Yes | |
| 119 | +| Set variable value | Yes | No | |
| 120 | +| Watch expressions | Yes | Yes | |
| 121 | +| Debug console evaluation | Yes | Yes | |
| 122 | +| Hover evaluation | Yes | Yes | |
| 123 | +| Completions (autocomplete) | Yes | No | |
| 124 | +| Console output streaming | Yes | No | |
| 125 | +| Breakpoint locations | Yes | No | |
| 126 | +| Exception info | Yes | No | |
| 127 | + |
| 128 | +## Links |
| 129 | + |
| 130 | +- [GitHub Repository](https://github.com/lucee/extension-debugger) |
| 131 | +- [Java Agent Setup](https://github.com/lucee/extension-debugger/blob/main/JAVA_AGENT.md) |
| 132 | +- [Issue Tracker](https://github.com/lucee/extension-debugger/issues) |
0 commit comments