# Thin VS Code LSP and replay-DAP extension Task ID: T-CLIENT-VSCODE-022 Role: astra_implementer Status: READY Depends on: T-PLAN-EDITORS-022 (complete), T-DAP-TRANSCRIPTS-020, T-REVIEW-DAP-020 ## 1. Context and baseline Shared /home/faumaray/Projects/VoidLanguageServer on feat/implement-roadmap at ca04975 plus uncommitted integration. Verified client tooling on this host: VS Code `1.147.0` (commit `8a14f0cc1b08d531eb83255ea3764ae22aa932b5`, x64), Node `v24.22.3` and npm `11.19.1`. The LSP and replay-DAP services already run in real stdio sessions; tests/native/DapReplay.py and tests/native/NeovimReplay.lua are the reference journeys. No VS Code client package exists. ## 2. Objective and deliverables Add the thin VS Code extension under clients/vscode/: a language client that launches the installed `vls --stdio` for the selected workspace, status commands for `providerStatus`/`analysisStatus`, and a debug configuration that launches `vls-dap --replay` on an absolute trace chosen by the user. Deliver a disposable extension-host acceptance test that uses temporary user-data and extensions directories. Keep all server semantics in C++. ## 3. Scope and non-goals In scope: package manifest, activation, language client startup and disposal, status command output, debug adapter descriptor, a bounded replay tree view or document provider for timeline/frames/source, stale-generation rejection and clean shutdown. Non-goals: semantic features in TypeScript, live debugging, marketplace publication, global installs, user-profile reuse, a second server, or any network fetch during tests. No webview that executes recorded values. ## 4. Files to inspect Read docs/roadmap/22-vscode-client.md, src/main.cpp, src/Server.cpp, src/debug/dap/{Main.cpp,Projection.cpp}, src/debug/inspection/ReplaySession.cpp, tests/native/{DapReplay.py, NeovimReplay.lua}, README.md and docs/agent-workflow/tasks/T-PLAN-EDITORS-022.md. Consult the installed VS Code `vscode.d.ts`, `vscode-languageclient` and `vscode-debugadapter` APIs for version 1.147.0. ## 5. Write ownership and coordination Write scope: clients/vscode/** and tests/native/VscodeClient.py. No edits to the server, DAP adapter, shared protocol headers, VBS/CMake registration, existing tests, user settings or installed extensions. Root owns build registration, docs and integration. The Neovim client is a disjoint package; no shared code. ## 6. Implementation approach Activate on a C++ document or an explicit command. Resolve the server executable from an explicit setting, never from the workspace `PATH`; start `LanguageClient` with `serverOptions.command` and `--stdio --workspace-root [--gcc-profile ]`. Register commands `vls.providerStatus` and `vls.analysisStatus` that render bounded JSON in an output channel. Register a `vls-replay` debug configuration taking an absolute trace path and using `vls-dap --replay` as the executable adapter. Render `vls/session`, `vls/timeline`, `vls/frames` and captured source in a read-only tree/document provider keyed by sessionId and generation; drop replies from an older generation. Dispose the client, adapter and views on deactivation. ## 7. Interfaces and data contracts LSP: initialize/sync, `positionEncoding`, workspace folders, `voidLanguageServer/providerStatus`, `voidLanguageServer/analysisStatus`. Launcher: `vls --stdio --workspace-root ABS [--provider ...] [--gcc-profile ABS]`. DAP: `vls-dap --replay ABSOLUTE_TRACE`; standard launch/configurationDone, `stopped`, `stackTrace`, `scopes`, `variables`, `loadedSources`, `source`, `continue`; custom `vls/session`, `vls/timeline`, `vls/frames`, `vls/seek`. Requests carry schemaVersion, sessionId and generation; paging stays bounded by the server. Do not reproduce server validation in TypeScript. ## 8. Dependencies and integration Node and npm are available; the extension test must reuse an installed VS Code executable and a locally created fixture. Any npm dependency is declared in the package manifest and fetched only by an explicit development step, never by the test. The acceptance script takes `VLS_SERVER`, `VLS_DAP`, `VLS_TRACE` and an optional `VLS_CODE`. It must pass `--user-data-dir`, `--extensions-dir` and `--disable-extensions` for a disposable host, with a hard deadline. ## 9. Edge cases, security and performance Unavailable server/adapter, a workspace-local executable with the same name, multi-root workspaces, omitted versus repeated settings, stale callbacks after stop/seek/terminated, switching recordings, replaced documents, binary captured source, extension deactivation and host shutdown. Never reuse a running editor profile, write user settings, open the recorded source as a workspace file, or execute recorded values. Bound waits, pages and rendered text. ## 10. Acceptance criteria 1. The extension activates in a disposable extension host and starts the installed server over stdio for a temporary workspace. 2. Status commands return provider and analysis state for the current document. 3. A recorded trace launches through the debug configuration, exposes the first stopped frame, pages the timeline, reads captured source by reference, and continues to the next recorded value. 4. A stale sessionId/generation reply is rejected without changing the view. 5. Deactivation and host shutdown leave no server/adapter process. ## 11. Verification commands and evidence ```sh code --version node --version && npm --version VLS_SERVER="$PWD/build/native/profiles/debug/out/bin/vls" \ VLS_DAP="$PWD/build/native/profiles/debug/out/bin/vls-dap" \ VLS_TRACE="$PWD/tests/debug/fixtures/integral-17.vls" \ python3 -B tests/native/VscodeClient.py ``` Record exact versions, commands, exit statuses, the extension-host log excerpt and the observed values. ## 12. Constraints and stop conditions No marketplace publication, global installs, user-profile edits or network during tests. Stop and return evidence if the installed VS Code cannot run a disposable extension host on this host. ## 13. Authorization and decisions Full roadmap D-022, primary VBS D-025, GPT-6.2 Astra at Max D-027/029. Client publishing and the project license remain deferred. ## 14. Return format T-CLIENT-VSCODE-022 DONE/PARTIAL. Return paths, exact versions, test output, supported commands and remaining limitations.