feat(debugger): integrate NX Tcl Remote Debugger into NX Postprocessor
build_and_puplish.yml / build_and_publish (release) Successful in 35s
build_and_puplish.yml / build_and_publish (release) Successful in 35s
Embed the NX Tcl Remote Debugger into the NX Postprocessor extension. Add a new debugging client, protocol, and adapter logic to drive attach/launch, breakpoints, stepping, and evaluation via the runtime adapter. - Introduced a client debugger with a new adapter and protocol - Wired attach/launch, breakpoints, stepping, and evaluation - Updated docs and licensing to reflect the embedded debugger
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# NX Postprocessor Support
|
||||
|
||||
A comprehensive VS Code extension providing language support for NX CAM postprocessor development, including CDL, TCL, and DEF files.
|
||||
A comprehensive VS Code extension providing language support and remote debugging for NX CAM postprocessor development, including CDL, TCL, and DEF files.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -10,6 +10,7 @@ A comprehensive VS Code extension providing language support for NX CAM postproc
|
||||
- **Intelligent Code Analysis** - Linting and error detection for postprocessor code
|
||||
- **Auto-completion** - Context-aware code completion for faster development
|
||||
- **Signature Help** - Shows parameters and documentation for custom and NX procedures
|
||||
- **NX Tcl Remote Debugger** - Breakpoints, stepping, call stack, scopes, variables, watches, evaluation, logpoints, hit conditions, and Tcl error stops directly in a running NX Post process
|
||||
|
||||
## Supported File Types
|
||||
|
||||
@@ -24,6 +25,10 @@ A comprehensive VS Code extension providing language support for NX CAM postproc
|
||||
3. Open any `.cdl`, `.tcl`, or `.def` file
|
||||
4. The extension will automatically activate and provide language support
|
||||
|
||||
The former standalone `NX Tcl Remote Debugger` extension is no longer required. Disable or
|
||||
uninstall `local-nx.nx-tcl-debug` before using the integrated debugger because both extensions
|
||||
register the same `nx-tcl` debug type.
|
||||
|
||||
## Configuration
|
||||
|
||||
The extension can be configured through VS Code settings:
|
||||
@@ -38,6 +43,49 @@ TCL files default to unlimited inlay hint length so that VS Code does not
|
||||
truncate later parameter names on a line. An explicit user setting for
|
||||
`editor.inlayHints.maximumLength` still takes precedence.
|
||||
|
||||
## NX Tcl Remote Debugger
|
||||
|
||||
### Add a VS Code attach configuration
|
||||
|
||||
Create `.vscode/launch.json` through **Run and Debug: create a launch.json file** and select
|
||||
**NX Tcl: Attach to NX Post**, or use this configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "nx-tcl",
|
||||
"request": "attach",
|
||||
"name": "Attach to NX Post Tcl",
|
||||
"host": "127.0.0.1",
|
||||
"port": 4711,
|
||||
"connectTimeout": 120000,
|
||||
"stopOnEntry": false,
|
||||
"breakOnError": true,
|
||||
"localRoot": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
When VS Code and NX see the source through different roots, set `remoteRoot` to the root used by
|
||||
NX and keep `localRoot` as the corresponding workspace root.
|
||||
|
||||
### Start debugging
|
||||
|
||||
1. Set breakpoints on executable Tcl or DEF commands.
|
||||
2. Start **Attach to NX Post Tcl** in VS Code before running the postprocessor.
|
||||
3. Start postprocessing in NX.
|
||||
4. Use Continue, Step Over, Step Into, Step Out, Pause, Variables, Watch, and the Debug Console as
|
||||
with a normal source debugger.
|
||||
|
||||
Breakpoints remain active and stop at every real invocation. Use a hit condition such as `1` for
|
||||
a one-time stop. Blank lines, comments, declarations, and multiline Tcl commands may be relocated
|
||||
to the nearest executable command; VS Code shows the resolved line. Dynamic
|
||||
`LIB_GE_command_buffer_edit_*` bodies are mapped back to their original source and owning Tcl
|
||||
procedure.
|
||||
|
||||
## Usage
|
||||
|
||||
Simply open any supported file type and enjoy:
|
||||
@@ -48,6 +96,7 @@ Simply open any supported file type and enjoy:
|
||||
- Code formatting (Format Document command)
|
||||
- Hover information
|
||||
- Signature help while entering procedure arguments
|
||||
- Remote NX Tcl debugging with breakpoints and full stepping
|
||||
|
||||
## Development and debugging
|
||||
|
||||
@@ -56,6 +105,7 @@ Install the root and client dependencies before the first debug session:
|
||||
```powershell
|
||||
npm install
|
||||
npm install --prefix client
|
||||
npm run test:debugger
|
||||
```
|
||||
|
||||
Use one of the checked-in VS Code launch configurations:
|
||||
@@ -78,4 +128,5 @@ This extension is actively maintained. For issues or feature requests, please vi
|
||||
|
||||
## License
|
||||
|
||||
AGPL-3.0 License - see LICENSE file for details.
|
||||
AGPL-3.0 License - see LICENSE file for details. The embedded NX Tcl Remote Debugger adapter
|
||||
retains its MIT notice in `debugger/NX_TCL_DEBUGGER_LICENSE.txt`.
|
||||
|
||||
Reference in New Issue
Block a user