# Thin Neovim LSP and replay-DAP client Task ID: T-CLIENT-NEOVIM-023 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: Neovim `0.12.6` (LuaJIT 2.1) and the isolated nvim-dap checkout `cfa2d58f4537aca6ca83e2de1a0d9f1491121264` under build/dap-evidence/nvim-dap. Existing real journeys: tests/native/NeovimReplay.lua drives the installed `vls-dap --replay` through a full nested-value session, and tests/native/NeovimDiagnostics.lua drives the built-in LSP client through a real unsaved edit, `voidLanguageServer/providerStatus` and stock GCC diagnostics. No client package exists in the repository. ## 2. Objective and deliverables Add the thin Neovim client under clients/neovim/: native LSP setup for the installed `vls`, passive provider/analysis status commands, and optional nvim-dap configuration for an offline replay selected by the user. Deliver one headless acceptance script that exercises the real installed executables. Keep server semantics in C++; the Lua layer only starts processes, forwards user actions and renders bounded replies. ## 3. Scope and non-goals In scope: plugin entry point, user commands, LSP client startup for a selected workspace root, optional stock GCC profile argument, replay DAP adapter registration, bounded timeline/frames/source views, stale-generation rejection and clean shutdown. Non-goals: live debugging, semantic features implemented in Lua, installing plugins into a user's configuration, distribution, and any network fetch. Do not add a second language server or debug adapter. ## 4. Files to inspect Read docs/roadmap/23-neovim-client.md, tests/native/{NeovimReplay.lua, NeovimDiagnostics.lua}, src/main.cpp (launcher options), src/Server.cpp (capabilities, providerStatus, analysisStatus), src/debug/dap/{Main.cpp, Projection.cpp}, src/debug/inspection/ReplaySession.cpp, README.md and docs/agent-workflow/tasks/T-PLAN-EDITORS-022.md. Use nvim-dap's checked documentation and `:help lsp` from Neovim 0.12.6. ## 5. Write ownership and coordination Write scope: clients/neovim/** and tests/native/NeovimClient.lua. No edits to the server, DAP adapter, shared protocol headers, VBS/CMake registration, existing tests, user configuration or the nvim-dap checkout. Root owns build registration, docs and integration. The VS Code client is a disjoint package; no shared TS/Lua code. ## 6. Implementation approach Use `vim.lsp.start` with an explicit executable, `--stdio`, the selected workspace root and the optional `--gcc-profile`; do not shell out to discover the server. Keep default LSP capabilities and let Neovim own buffers and diagnostics. Commands: `:VlsStatus` requests `voidLanguageServer/providerStatus` for the current document; `:VlsAnalysisStatus` requests `voidLanguageServer/analysisStatus`; `:VlsReplay ` registers a single nvim-dap adapter `vls-dap --replay ` and starts a launch only when the user invokes it. Timeline/frames/source views use `vls/session`, `vls/timeline`, `vls/frames` and standard `loadedSources`/`source` with the current generation from the session reply. Reject replies whose sessionId or generation differs from the subscribed generation. Close the session and drop buffers on `terminated` or disconnect. ## 7. Interfaces and data contracts LSP: existing initialize/sync, `positionEncoding`, `workspaceFolders`, `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`. Every custom request carries schemaVersion, sessionId and generation; paging is bounded by the server. Render only server-provided strings; never execute recorded values. ## 8. Dependencies and integration Neovim 0.12.6 is already available; nvim-dap remains an optional test-only dependency located by `VLS_NVIM_DAP`. The acceptance script takes `VLS_SERVER`, `VLS_DAP`, `VLS_TRACE`, `VLS_NVIM_DAP` and, where diagnostics are exercised, `VLS_GCC_PROFILE`. No dependency is installed by the test. Root binds the script to an actual registered target only after the client exists. ## 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 buffers, binary captured source and disconnect cleanup. Do not reuse or modify the user's editor profile; the headless test must use `-u NONE -i NONE` and a temporary workspace. Bound every wait and buffer render. Never open generated source as a workspace file or clear third-party mappings/listeners. ## 10. Acceptance criteria 1. Headless Neovim starts the installed server over stdio for a temporary workspace and receives provider status for the current document. 2. A real unsaved edit still yields and clears stock GCC diagnostics when a profile is supplied. 3. A recorded trace opens through nvim-dap, exposes the first stopped frame, pages the timeline, reads captured source by reference, and follows continue to the next recorded value. 4. A stale sessionId/generation reply is rejected without changing the view. 5. Terminating the session leaves no running server/adapter process and no stale buffers or listeners. ## 11. Verification commands and evidence ```sh nvim --version git -C build/dap-evidence/nvim-dap rev-parse HEAD 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" \ VLS_NVIM_DAP="$PWD/build/dap-evidence/nvim-dap" \ nvim --headless -u NONE -i NONE -l tests/native/NeovimClient.lua ``` Record exact versions, commands, exit statuses and the observed values. ## 12. Constraints and stop conditions No plugin installation, no user-config edits, no network, no commit or release. Stop and return evidence if the installed Neovim or nvim-dap cannot expose a required interface. ## 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-NEOVIM-023 DONE/PARTIAL. Return paths, exact versions, test output, supported commands and remaining limitations.