Skip to content

Napper LSP: Phase 1-2 scaffold, shared features, 14 integration tests#8

Merged
MelbourneDeveloper merged 24 commits intomainfrom
AgentSwarmBigBang
Mar 26, 2026
Merged

Napper LSP: Phase 1-2 scaffold, shared features, 14 integration tests#8
MelbourneDeveloper merged 24 commits intomainfrom
AgentSwarmBigBang

Conversation

@MelbourneDeveloper
Copy link
Copy Markdown
Collaborator

TLDR;

New napper-lsp F# language server (Phase 1-2 only — NO cutover). Replaces duplicated TypeScript parsing logic with shared F# in Napper.Core. 14 integration tests over real JSON-RPC stdio.

Details

New Napper.Core modules (shared by CLI and LSP):

  • CurlGenerator.fs — generates curl commands from NapRequest
  • SectionScanner.fs — finds [section] header positions for document symbols
  • Environment.detectEnvironmentNames — scans .napenv.* files, returns env names

New LSP project (src/Nap.Lsp/):

  • stdio JSON-RPC transport via Ionide.LanguageServerProtocol
  • textDocument/documentSymbol — sections for .nap and .naplist (replaces extractHttpMethod, parsePlaylistStepPaths in TS)
  • textDocument/codeLens — request section detection (replaces CodeLens TS parsing)
  • workspace/executeCommand:
    • napper.requestInfo — method + URL + headers (replaces parseMethodAndUrl in TS)
    • napper.copyCurl — curl string (replaces curl generation in TS)
    • napper.listEnvironments — env names (replaces detectEnvironments in TS)

Specs updated: LSP-SPEC, LSP-PLAN, IDE-EXTENSION-SPEC, IDE-EXTENSION-PLAN, ZED-EXTENSION-PLAN, Claude.md

No existing code modified. LSP is a parallel project — cutover is Phase 3 (not started).

How do the tests prove the change works

14 integration tests in src/Nap.Lsp.Tests/ — each launches the real napper-lsp binary as a subprocess and talks JSON-RPC over stdio (the exact same protocol VSCode and Zed use):

  • initialize handshake returns correct capabilities
  • initialized notification accepted
  • didOpen/didChange/didClose document sync
  • shutdown + exit clean lifecycle
  • malformed request survives gracefully
  • unknown method returns LSP error
  • documentSymbol returns sections for .nap file (meta, request, assert)
  • documentSymbol returns sections for .naplist file (meta, steps)
  • codeLens returns lenses for .nap request sections
  • executeCommand requestInfo returns parsed method + URL
  • executeCommand copyCurl returns curl string
  • executeCommand listEnvironments returns env names from .napenv.* files

MelbourneDeveloper and others added 20 commits March 16, 2026 20:46
New shared modules in Napper.Core consumed by the LSP:
- CurlGenerator.fs: generates curl commands from NapRequest
- SectionScanner.fs: finds section header positions for document symbols

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extension now checks bundled bin/ CLI before falling back to PATH
- Add extensionDir tracking to resolve bundled binary path
- Improve checkVersionMatch to check storage, bundled, then PATH
- Add debug logging throughout CLI version check and run flow
- Refactor installParams/tryBinaryInstall to use DownloadBinaryParams type
- Remove redundant settings.json injection from vscode-test setup
- Import CLI_BIN_DIR and DownloadBinaryParams where needed
- Run Prettier on cliInstaller.ts and extension.ts
- Run Fantomas on TestHelpers.fs and CliArgTests.fs
- Thread &Path through route_completions/collect_file_completions to
  eliminate set_current_dir race condition in parallel Rust tests
- Merge complete_* test assertions into route_completions_* tests
- Rust: apply cargo fmt to lib.rs (route_completions signature,
  cwd binding, NAP_RUN_COMMAND match arm)
- TypeScript: split oversized arrow functions in cliInstaller.ts
  (handleNon200, downloadPair extracted) to satisfy max-lines-per-function;
  move edit/import command registrations to editAndImportCommands.ts
- F#: add findRepoRoot() to TestHelpers so CLI integration tests locate
  the build-output napper binary (bin/Debug/net10.0/napper) instead of
  falling back to bare 'napper' which is not on PATH in CI
- Add Napper.Lsp test execution to test-fsharp Makefile target
- Skip LSP coverage threshold when 0 assemblies covered (integration tests use subprocess)
- Guard coverage extraction when report file missing
@MelbourneDeveloper MelbourneDeveloper merged commit 17a2010 into main Mar 26, 2026
4 checks passed
@MelbourneDeveloper MelbourneDeveloper deleted the AgentSwarmBigBang branch March 26, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant