feat(commands): ChangeSymbolTo -range, GenerateLinks path filter, NuwikiGenerateTags
CI / cargo fmt --check (push) Successful in 29s
CI / cargo clippy (push) Successful in 34s
CI / cargo test (push) Successful in 45s
CI / editor keymaps (push) Failing after 1m43s

Closes the three new command gaps from the 2026-05-31 re-audit (all real,
client-side, both clients × Vimwiki/Nuwiki):

- VimwikiChangeSymbolTo / ListChangeSymbolI / NuwikiChangeSymbol are now
  -range -nargs=1 via a new list_change_symbol_range(symbol,l1,l2) helper that
  loops over_range; was -nargs=1 only → E481 on a visual selection.
  ChangeSymbolInListTo/InList stay range-less.
  Bonus: the Neovim VimwikiChangeSymbolInListTo + NuwikiChangeSymbolInList defs
  passed whole_list=false, changing only the current item — corrected to true.

- VimwikiGenerateLinks / NuwikiGenerateLinks are now -nargs=?; with an arg the
  client dispatches the existing server command nuwiki.links.generateForPath
  ({path}) for real subtree-scoped link generation, else nuwiki.links.generate.
  Was bare → E488 on an arg.

- Added NuwikiGenerateTags (Vim + Neovim) mirroring VimwikiGenerateTags, with
  -nargs=? -complete=…tags — closes the :Vimwiki*↔:Nuwiki* alias asymmetry.

Tests: cmd.ChangeSymbolTo_range_sets_marker, cmd.GenerateLinks_accepts_optional_path,
cmd.NuwikiGenerateTags_exists (test-keymaps.lua, 283 pass) +
cmd.VimwikiChangeSymbolTo_accepts_range, cmd.VimwikiGenerateLinks_accepts_path,
cmd.NuwikiGenerateTags_exists (test-keymaps-vim.vim, 272/18/21). fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 21:48:31 +00:00
parent 773bbdb6a6
commit f616915581
5 changed files with 105 additions and 27 deletions
+18 -2
View File
@@ -590,8 +590,17 @@ endfunction
function! nuwiki#commands#toc_generate() abort
call s:exec('nuwiki.toc.generate', [{'uri': s:buf_uri()}])
endfunction
function! nuwiki#commands#links_generate() abort
call s:exec('nuwiki.links.generate', [{'uri': s:buf_uri()}])
" `:VimwikiGenerateLinks [rel_path]` — with no arg, list every page; with a
" rel-path arg, scope the generated links to that subtree (server-side
" `generateForPath`). Matches upstream's optional path argument.
function! nuwiki#commands#links_generate(...) abort
let l:path = a:0 >= 1 ? a:1 : ''
if l:path !=# ''
call s:exec('nuwiki.links.generateForPath',
\ [{'uri': s:buf_uri(), 'path': l:path}])
else
call s:exec('nuwiki.links.generate', [{'uri': s:buf_uri()}])
endif
endfunction
function! nuwiki#commands#check_links(...) abort
" a:1 = range count; when >0, restrict the report to the current buffer's
@@ -789,6 +798,13 @@ function! nuwiki#commands#list_change_symbol(symbol, whole_list) abort
call s:exec('nuwiki.list.changeSymbol', l:args)
endfunction
" `:[range]VimwikiChangeSymbolTo {sym}` / `:[range]VimwikiListChangeSymbolI {sym}`
" — upstream is `-range -nargs=1`; a range sets the marker on every list item in
" the selection (single-item when no range, since line1==line2==cursor line).
function! nuwiki#commands#list_change_symbol_range(symbol, l1, l2) abort
call s:over_range(a:l1, a:l2, { -> nuwiki#commands#list_change_symbol(a:symbol, 0) })
endfunction
function! nuwiki#commands#list_change_level(delta, whole_subtree) abort
let l:p = s:cursor_position()
let l:args = [{