Skip to content

Phase 3: Stabilization (checkhealth, tests, docs)#12

Open
Schmarvinius wants to merge 1 commit into
mainfrom
phase-3-stabilization
Open

Phase 3: Stabilization (checkhealth, tests, docs)#12
Schmarvinius wants to merge 1 commit into
mainfrom
phase-3-stabilization

Conversation

@Schmarvinius

Copy link
Copy Markdown
Owner

Closes #8.

Non-functional stabilization for the expanded plugin.

:checkhealth nvim-ask (lua/nvim-ask/health.lua)

Reports:

  • Neovim version (>= 0.9)
  • registered + selected backend, delegating to the backend's own health()
  • available presets
  • enabled context providers (warns if git_diff is on but git is missing)

Supports both the modern (vim.health.start) and legacy (report_*) APIs.

Test suite (plenary.nvim, busted style — tests/spec/)

  • parser — multi-block, c++/c# langs, info strings, unterminated fences
  • prompt — selection + extra context + history + bare instruction
  • presets — defaults / override / add / names / unknown
  • context — surrounding (clamped, selection-gated), whole file, combined
  • backends — registry resolve/opts/register + claude interface + safe stop
  • diffunified() plus preview accept/reject/no-changes UI
  • health:checkhealth nvim-ask produces a report
  • ui — full multi-turn integration (stream → complete → follow-up with history → retry → apply) via a fake backend

43 tests, all passing (exit code 0).

Tooling

  • tests/minimal_init.lua self-discovers plenary via PLENARY_DIR, a local .tests/ clone, or an existing lazy/packer install, and sources its plugin explicitly (works under --clean).
  • Makefile: make test / make deps / make clean; non-zero exit on failure.
  • .gitignore: ignore .tests/.
  • README: :checkhealth section + Development/testing section.

Verification

$ make test   # 43 passed, exit code 0

Related

Completes the phased plan: #5, #6, #7 (merged) → #8 (this).

Stabilization phase.

checkhealth (health.lua):
- :checkhealth nvim-ask reports Neovim version, registered/selected backend
  (delegating to the backend's own health()), available presets, and enabled
  context providers; supports both modern and legacy vim.health APIs

Tests (plenary.nvim, busted style, under tests/spec/):
- parser: multi-block, c++/c# langs, info strings, unterminated fences
- prompt: selection + extra context + history + bare instruction
- presets: defaults/override/add/names/unknown
- context: surrounding (clamped, selection-gated), whole file, combined
- backends: registry resolve/opts/register + claude interface + safe stop
- diff: unified() + preview accept/reject/no-changes UI
- health: :checkhealth produces a report
- ui: full multi-turn integration (stream -> complete -> follow-up with
  history -> retry -> apply) via a fake backend

Tooling:
- tests/minimal_init.lua self-discovers plenary (PLENARY_DIR, .tests/, or an
  installed lazy/packer copy) and sources its plugin explicitly
- Makefile: make test / make deps / make clean; exits non-zero on failure
- .gitignore: ignore .tests/
- README: document :checkhealth and how to run tests

All 43 tests pass (exit code 0).
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.

Phase 3: Stabilization (checkhealth, tests, docs)

1 participant