Commit Graph

4 Commits

Author SHA1 Message Date
gffranco 769580af75 chore(scripts): add test-personal-wiki.sh + NUWIKI_DEV_NO_SEED
test-personal-wiki.sh wraps start-vim.sh to open the user's real wiki
at ~/.vimwiki/personal_wiki (override with NUWIKI_PERSONAL_WIKI) — used
when reproducing user-reported bugs against actual content instead of
the seeded smoke-test wiki.

Also adds a NUWIKI_DEV_NO_SEED env var to start-vim.sh so seed_wiki
doesn't drop a scratch Notes.wiki into the user's real notes when we
point WIKI_DIR at an already-populated wiki.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 22:47:13 -03:00
gffranco bcb32777fb chore(dev): always rebuild release binary in start scripts
ensure_binary used to short-circuit whenever bin/nuwiki-ls existed,
which left vim/nvim running an outdated LSP after every source change.
Now always invoke cargo build (incremental, so a no-op when nothing
changed) and refresh the symlink + log the build timestamp. Add
NUWIKI_DEV_SKIP_BUILD=1 for the rare opt-out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 15:00:57 +00:00
gffranco c3a8eae9d0 fix(vim): vim-lsp detection + drop hang-prone echo lines
CI / cargo fmt --check (push) Successful in 32s
CI / cargo clippy (push) Successful in 1m22s
CI / cargo test (push) Successful in 1m18s
`autoload/nuwiki/lsp.vim` probed vim-lsp via `exists('*lsp#register_server')`
but autoload functions aren't loaded until first call — that check
always returned false on the dev script's setup, so the plugin
printed "no supported LSP client found" even after vim-lsp had been
cloned + added to the runtimepath.

vim-lsp's `plugin/lsp.vim` sets `g:lsp_loaded = 1` only when its
hard requirements (`json_encode`, `timers`, `lambda`) are met, so
that's the reliable presence flag. Switched to `exists('g:lsp_loaded')`.

Also replaced `echo` with `echomsg` in the generated `start-vim.sh`
vimrc — the two startup status lines were pushing past `'cmdheight'`
and triggering "Press ENTER or type command to continue", which made
non-interactive invocations exit before the buffer was usable.
`echomsg` writes to `:messages` history without the prompt.

Verified with `vim --clean -u $DEV/vimrc index.wiki`:
- `g:lsp_loaded = 1`
- `filetype = vimwiki`
- `:VimwikiTOC` defined (buffer-local), `b:did_ftplugin = 1`
- No "press ENTER" hang.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 01:15:53 +00:00
gffranco cf94f99d3c dev: minimal-config launchers for nvim/vim plugin testing
CI / cargo fmt --check (push) Successful in 28s
CI / cargo clippy (push) Successful in 1m8s
CI / cargo test (push) Successful in 1m27s
Two scripts at the repo root that spin up an isolated editor session
against this checkout, so changes to the plugin or LSP can be smoke-
tested without polluting the user's real (n)vim install:

- start-nvim.sh — builds nuwiki-ls in release mode, symlinks it into
  `bin/`, seeds a scratch wiki under `$XDG_CACHE_HOME/nuwiki-dev/wiki`,
  generates a minimal `init.lua` that prepends this repo to
  `runtimepath`, points `vim.env.XDG_*` at the dev cache so the host's
  Neovim state is untouched, and execs `nvim --clean -u <init>`.

- start-vim.sh — same shape for Vim. Clones vim-lsp + async.vim into
  the dev cache on first run so the LSP path is actually exercisable
  (the plugin's autoload layer prefers vim-lsp). Opt-out via
  `NUWIKI_DEV_NO_LSP=1` for syntax-only testing.

Both scripts:
- Are idempotent (skip cargo build / git clone / wiki seed when their
  outputs are already in place).
- Pass through extra args to the editor; default to opening the
  scratch wiki's index page.
- Accept `NUWIKI_DEV_WIKI=<path>` to point at a custom sandbox.
- Seed `index.wiki` + `Notes.wiki` with smoke-test content covering
  wikilinks, anchors, checkboxes, tags, and the `:Vimwiki*` command
  surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:04:11 +00:00