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>
`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>
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>