Add Windows dev-host tasks; include tclint builtins; register LIB_CONF_prop_custom_proc_body #55

Merged
Christoph merged 3 commits from ramon_fixes into main 2026-10-01 13:41:01 +00:00
Owner

This change set adds Windows support for launching the Extension Development Host for debugging, expands the TCL completion command list to include tclint's builtin commands, and registers a new poco plugin handler to parse LIB_CONF_prop_custom_proc_body.

Summary of changes

  • VS Code debug and task changes

    • Added a PowerShell helper script: .vscode/start-dev-host.ps1.
      • Launches the Extension Development Host with a fixed inspector port via --inspect-brk-extensions=$InspectPort and forwards the exit code.
      • Expects the VS Code executable path in the NXPS_VSCODE_EXEC_PATH environment variable and looks up a *.cmd entry in the CLI bin directory.
      • Strips a leading \\?\ prefix from the workspace path to avoid path issues.
    • Added two Windows tasks in .vscode/tasks.json:
      • NX Post Support: Start Dev Host (Windows) — runs the PowerShell script and sets NXPS_VSCODE_EXEC_PATH from ${execPath}.
      • NX Post Support: Start Dev Host with debugpy (Windows) — same, with USE_DEBUGPY, NXPS_DEBUG_HOST and NXPS_DEBUG_PORT environment variables set.
    • Updated .vscode/launch.json to:
      • Add windows-specific outFiles, resolveSourceMapLocations, and preLaunchTask entries for the attach configurations.
      • Rename some configurations from "(Linux)" to "(Attach)" to reflect that the attach flow is now platform-agnostic.
    • Concrete behavior: previously js-debug's extensionHost attach probed localhost and [::1] in parallel; a refused IPv6 inspector could cause the attach to abort. The new tasks + script open the dev host with a fixed inspector port and the launch configs attach directly to 127.0.0.1, avoiding the IPv6 probe failure mode.
  • TCL completion changes

    • server/src/tools/tcl_command_completion.py now imports tclint.commands.builtin.commands as TCLINT_BUILTIN_COMMANDS and adds that set to TCL_COMMAND_NAMES.
    • Concrete behavior: the completion command list now includes all tclint-provided builtin commands (covers Tcl 8.6 builtins, including commands without subcommands such as llength, lindex, while). This is driven directly by the updated construction of TCL_COMMAND_NAMES.
  • poco plugin change

    • server/src/plugins/poco_plugin.py adds a _lib_prop_custom_proc_body helper that calls parser.parse_script on args[0] and returns the parsed args.
    • Registers the handler by adding {"LIB_CONF_prop_custom_proc_body": _lib_prop_custom_proc_body} to the commands table.
    • Concrete behavior: the LIB_CONF_prop_custom_proc_body command is now parsed (script body is parsed) instead of being left unprocessed.

Testing

No test execution results were provided.

Recommended checks for reviewers:

  • Windows dev-host flow
    • Run the new task NX Post Support: Start Dev Host (Windows) (or the debugpy variant) and verify the Extension Development Host starts with the inspector on the configured port (default 9333) and that the attach configuration can connect to 127.0.0.1.
    • Verify the task's environment provides a valid ${execPath} (the task sets NXPS_VSCODE_EXEC_PATH) and that start-dev-host.ps1 finds a *.cmd launcher in the VS Code bin directory on the system where you test.
  • TCL completions
    • Start the language server and check that TCL_COMMAND_NAMES (or completions in the editor) includes expected builtins (for example llength, lindex, while).
  • poco plugin
    • Exercise LIB_CONF_prop_custom_proc_body handling in the plugin (unit test or an input that triggers the command) and confirm args[0] is parsed via parser.parse_script.

Notes / reviewer actions

  • The new script relies on the NXPS_VSCODE_EXEC_PATH environment variable being set by the task. The tasks set this to ${execPath}; confirm ${execPath} resolves correctly in your environment or adjust if needed.
  • start-dev-host.ps1 intentionally trims a leading \\?\ from long paths and looks for a *.cmd in the bin directory adjacent to the VS Code executable — please confirm this logic suits your platform's VS Code layout.
  • Formatting/whitespace-only adjustments were made in server/src/plugins/poco_plugin.py; the significant functional addition is _lib_prop_custom_proc_body and its registration.

If you want, I can extract focused unit-test suggestions or a short checklist to validate the Windows attach flow step-by-step.

This change set adds Windows support for launching the Extension Development Host for debugging, expands the TCL completion command list to include tclint's builtin commands, and registers a new poco plugin handler to parse `LIB_CONF_prop_custom_proc_body`. ## Summary of changes - VS Code debug and task changes - Added a PowerShell helper script: `.vscode/start-dev-host.ps1`. - Launches the Extension Development Host with a fixed inspector port via `--inspect-brk-extensions=$InspectPort` and forwards the exit code. - Expects the VS Code executable path in the `NXPS_VSCODE_EXEC_PATH` environment variable and looks up a `*.cmd` entry in the CLI `bin` directory. - Strips a leading `\\?\` prefix from the workspace path to avoid path issues. - Added two Windows tasks in `.vscode/tasks.json`: - `NX Post Support: Start Dev Host (Windows)` — runs the PowerShell script and sets `NXPS_VSCODE_EXEC_PATH` from `${execPath}`. - `NX Post Support: Start Dev Host with debugpy (Windows)` — same, with `USE_DEBUGPY`, `NXPS_DEBUG_HOST` and `NXPS_DEBUG_PORT` environment variables set. - Updated `.vscode/launch.json` to: - Add `windows`-specific `outFiles`, `resolveSourceMapLocations`, and `preLaunchTask` entries for the attach configurations. - Rename some configurations from "(Linux)" to "(Attach)" to reflect that the attach flow is now platform-agnostic. - Concrete behavior: previously js-debug's extensionHost attach probed `localhost` and `[::1]` in parallel; a refused IPv6 inspector could cause the attach to abort. The new tasks + script open the dev host with a fixed inspector port and the launch configs attach directly to `127.0.0.1`, avoiding the IPv6 probe failure mode. - TCL completion changes - `server/src/tools/tcl_command_completion.py` now imports `tclint.commands.builtin.commands` as `TCLINT_BUILTIN_COMMANDS` and adds that set to `TCL_COMMAND_NAMES`. - Concrete behavior: the completion command list now includes all tclint-provided builtin commands (covers Tcl 8.6 builtins, including commands without subcommands such as `llength`, `lindex`, `while`). This is driven directly by the updated construction of `TCL_COMMAND_NAMES`. - poco plugin change - `server/src/plugins/poco_plugin.py` adds a `_lib_prop_custom_proc_body` helper that calls `parser.parse_script` on `args[0]` and returns the parsed args. - Registers the handler by adding `{"LIB_CONF_prop_custom_proc_body": _lib_prop_custom_proc_body}` to the `commands` table. - Concrete behavior: the `LIB_CONF_prop_custom_proc_body` command is now parsed (script body is parsed) instead of being left unprocessed. ## Testing No test execution results were provided. Recommended checks for reviewers: - Windows dev-host flow - Run the new task `NX Post Support: Start Dev Host (Windows)` (or the debugpy variant) and verify the Extension Development Host starts with the inspector on the configured port (default 9333) and that the attach configuration can connect to `127.0.0.1`. - Verify the task's environment provides a valid `${execPath}` (the task sets `NXPS_VSCODE_EXEC_PATH`) and that `start-dev-host.ps1` finds a `*.cmd` launcher in the VS Code `bin` directory on the system where you test. - TCL completions - Start the language server and check that `TCL_COMMAND_NAMES` (or completions in the editor) includes expected builtins (for example `llength`, `lindex`, `while`). - poco plugin - Exercise `LIB_CONF_prop_custom_proc_body` handling in the plugin (unit test or an input that triggers the command) and confirm `args[0]` is parsed via `parser.parse_script`. ## Notes / reviewer actions - The new script relies on the `NXPS_VSCODE_EXEC_PATH` environment variable being set by the task. The tasks set this to `${execPath}`; confirm `${execPath}` resolves correctly in your environment or adjust if needed. - `start-dev-host.ps1` intentionally trims a leading `\\?\` from long paths and looks for a `*.cmd` in the `bin` directory adjacent to the VS Code executable — please confirm this logic suits your platform's VS Code layout. - Formatting/whitespace-only adjustments were made in `server/src/plugins/poco_plugin.py`; the significant functional addition is `_lib_prop_custom_proc_body` and its registration. If you want, I can extract focused unit-test suggestions or a short checklist to validate the Windows attach flow step-by-step.
Add a new helper _lib_prop_custom_proc_body that runs parser.parse_script
on the first argument and returns the modified args. Register this handler
in the commands mapping so LIB_CONF_prop_custom_proc_body is recognized
and its body is parsed as a script.

Also apply small formatting/line-break cleanups (compact if/raise and
call formatting) for consistency.
Add .vscode/start-dev-host.ps1 and two Windows tasks to start the
Extension Development Host with a fixed inspector port so the debugger
can attach to 127.0.0.1 (workaround for js-debug probing localhost/[::1]).

- tasks.json: add "Start Dev Host (Windows)" and "Start Dev Host with debugpy (Windows)"
  tasks that invoke the new PowerShell script and set NXPS_VSCODE_EXEC_PATH / debug env vars.
- launch.json: rename several configurations to "Attach" and add "windows" blocks
  (outFiles, resolveSourceMapLocations, disable auto-attach child options) that
  point to the new Windows preLaunchTask names.

Before: only Linux preLaunchTask/script existed for starting the dev host.
After: equivalent Windows flow is available, allowing the debugger to attach on Windows.
feat(completion): include tclint builtins in TCL command list
All checks were successful
Tests / node (pull_request) Successful in 23s
Tests / python (pull_request) Successful in 33s
21a8749c55
Import tclint.commands.builtin.commands and include its entries in
TCL_COMMAND_NAMES. Previously the command name list was derived only
from subcommands, options, snippets and dynamic rules, so Tcl 8.6
builtins that have no subcommands/options/snippets (e.g. llength,
lindex, while) could be omitted from completions. This ensures those
builtins are available in completion suggestions.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Christoph/nx_post_support!55
No description provided.