[P3] Epic: source debugging for SharpTS interpreter mode via DAP

Open
#1,400 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
csharp, typescript, vscode

Research direction

Start with #1405 and the documented work at local commit d944f489, then review the remaining release gates in this epic. Done means the commit is integrated and passes CI, the SharpTS.DebugAdapter package is published, and the VS Code UI checklist is completed for both development-host and packaged-VSIX installs before closing #1405 and this epic.

Written by the indexing model from the issue text.

Description

deferred enhancement epic priority: P3

Goal

Deliver first-class source debugging for SharpTS interpreter mode through a standards-based Debug Adapter Protocol (DAP) implementation, if and only if interpreter-debugging demand justifies a separate debugger product.

This is intentionally separate from #1306 and from compiled-mode portable-PDB debugging. A managed debugger cannot control the SharpTS AST interpreter; this epic requires debugger protocol, execution-control, inspection, async, and editor-integration work of its own.

Status — automated acceptance refreshed 2026-10-26

The implementation and automated debugger acceptance are substantially complete. Keep this epic open until #1405's remaining release and visual acceptance gates are complete.

The former local-only status of d944f489303925b78598ba5ea16259ab59aa3d0c is obsolete: it is integrated into main. Historical CI run 37869060276 passed Windows/Linux builds, package checks, TypeScript conformance, and the macOS adapter smoke. PR #2999 carries the current P3 audit and subsequent corrections.

Final PR CI passed: CI 40287177949 and Desktop GUI 40287177788 succeeded for source 1e436f1ba32dc8ef2c43963c7afd4a7d8d15e453 (29 successful checks, two expected skips). PR #2999 merged as 42e1c2518595273b356902e5431585c8d1473e95. The frozen release source is an ancestor of that merge and its complete tracked tree is identical. Visual acceptance and public NuGet publication remain open.

Completed implementation and local verification:

  • #1401–#1403 were delivered by #1406; #1404 was completed by 497d7900.
  • Product and architecture decisions, execution model, inspection/evaluation policy, performance bounds, packaging model, and manual acceptance procedure are documented.
  • The acceptance fixture, bounded adapter logging, project/config/reference-aware VS Code launch command, extension integration tests, cross-platform package smoke gates, and final visual checklist are implemented.
  • The integrated source passed a full Release solution build with 0 warnings and 0 errors, 405 combined tests with IL verification, and the code-quality gates. Broader core, GUI, TypeScript and Test262 baseline-comparison evidence is retained in artifacts/p3/state.json; those earlier checks retain their recorded source scope.
  • The frozen release candidate is SharpTS.DebugAdapter 1.0.13, built from clean source 1e436f1ba32dc8ef2c43963c7afd4a7d8d15e453. Package metadata and both assembly informational versions identify that exact source. Its local-only exact-version installation and installed sharpts-dap protocol smoke passed.
  • That candidate passed 20 real VS Code extension-host API/DAP sessions: ten with the development extension and ten with the installed VSIX, on VS Code 1.141.0 / Windows x64 / .NET SDK 10.0.402. Coverage includes saved/changed source, project and managed-reference context, breakpoints, scopes, evaluation, stepping, async/generator resumption, workers, exceptions, restart, stop, and shutdown. These are API/protocol assertions; they do not complete visual presentation acceptance.
  • The latency gate passed its documented median limits of 50 ms for continue-to-breakpoint and 100 ms for variable expansion. The adapter package adds 149,497 compressed bytes, below the 5 MiB bound.
  • Exact source, artifact hashes, test paths, and scope are recorded in artifacts/p3/release-1e436f1ba/candidate-manifest.json. The 1.0.13 package SHA-256 is 66ea6379c59887fdac68a4951b62fea23aefac2090e6deb470060eb757e380fe; its size is 8,546,240 bytes. The candidate has not been published.

Release gates and closure

  1. Integrate the former local commit d944f489 and obtain its CI results; that historical integration task is complete.
  2. Final PR #2999 CI passed for 1e436f1ba; merge 42e1c2518595273b356902e5431585c8d1473e95 contains that source unchanged, with identical tracked tree.
  3. Onboard SharpTS.DebugAdapter on public NuGet using the intended first-release package; an ID cannot be reserved independently of a package upload. Confirm release-owner access, trusted-publisher policy, and public package/version availability without bypassing repository preflight.
  4. Run and record the complete visual checklist in both a VS Code Extension Development Host and a clean installed-VSIX profile, including environment details, in #1405. The human request for an active Windows desktop, workspace trust, and the signed-in NuGet owner session remains pending.
  5. Close #1405 only after its complete criteria pass, then close this epic.

Product/architecture gate

Before implementation proceeds beyond the protocol foundation:

  • Document concrete interpreter-debugging use cases that compiled --debug does not satisfy (startup latency, interpreter-only behavior, embedding, REPL/evaluation, hot reload, etc.).
  • Choose a DAP process/hosting model (sharpts-dap tool or another explicit boundary), launch-only v1 scope, packaging/versioning, and security model.
  • Define the supported concurrency model for event-loop callbacks, tasks, and workers.
  • Define expression-evaluation side-effect policy and how guest exceptions from debugger evaluation are contained.
  • Approve the maintenance cost of a debugger state machine and editor integration; otherwise close the epic as not planned with the decision recorded.

Planned children and dependencies

  • #1401 — DAP protocol, lifecycle, packaging, and deterministic test harness. Foundation for all children.
  • #1402 — interpreter execution control, breakpoint binding, and step semantics. Depends on #1401.
  • #1403 — stack frames, lexical scopes, variables, and safe evaluation. Depends on #1401 and #1402.
  • #1404 — async flow, exceptions/rejections, modules, and workers. Depends on #1402 and #1403.
  • #1405 — VS Code integration, final packaging, documentation, and end-to-end acceptance. Depends on #1401–#1404. Repository implementation, automated acceptance, and the recorded performance measurements are complete to the evidence above and #1405's updated record; public release and visual acceptance stay open there.
#1401 ──> #1402 ──> #1403 ──> #1404 ──> #1405

Cross-cutting requirements

  • Use original TypeScript SourceDocument/span provenance and lexical environments; do not infer locations or variables from display text.
  • Interpreter behavior without an attached debugger remains unchanged and pays negligible overhead when debugging is disabled.
  • Pausing is cooperative, deterministic at declared safe points, and cannot deadlock the event loop or host process.
  • DAP messages are versioned/tested over stdio and do not depend on VS Code internals.
  • Every request observes cancellation/disconnect and returns protocol errors instead of crashing the debuggee or adapter.
  • Imported modules, virtual stdlib documents, exceptions, promises/timers, and nested calls have an explicit presentation policy.

Epic acceptance

  • Every child meets its focused automated and manual verification criteria.
  • A packaged adapter launches a representative interpreted multi-module TS/TSX program from VS Code and at least one other DAP client or protocol harness. The installed-tool protocol harness and both VS Code extension-host API profiles pass; manual visual VS Code verification remains.
  • Breakpoints bind in entry/imported files; continue, pause, step in/over/out, stack traces, scopes, variables, watches/evaluate, and exception stops behave according to the documented contract.
  • Async/timer/module behavior remains live while running and stable while paused; disconnect/termination leaves no orphan process or blocked worker.
  • Protocol transcript tests are deterministic and cover invalid order, cancellation, disconnect, malformed requests, and debuggee failure.
  • Interpreter conformance and performance baselines show no non-debug regression; compiled-mode debugging remains unaffected.
  • Packaging, VS Code configuration, client-agnostic setup, limitations, and troubleshooting are documented.

Non-goals unless separately approved

  • Time-travel/reverse debugging.
  • Hot code replacement.
  • Native/managed debugging inside CLR calls.
  • Attaching to an arbitrary already-running embedded interpreter in v1.
  • Perfect V8/Node Inspector protocol compatibility; DAP is the editor boundary.

Related: #1306, #1399.

Dominant language
C#
Stars
156
Forks
4
Avg merge
14h 45m
Merged PRs (30d)
40

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nickna/SharpTS

All issues in nickna/SharpTS

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.