gffranco ad1b55a401
CI / cargo fmt --check (push) Successful in 19s
CI / cargo clippy (push) Successful in 1m11s
CI / cargo test (push) Successful in 1m21s
backfill: tag commands + file-operations capability
SPEC audit of Phases 12–13 surfaced two gaps. Closing them here so the
v1.1 command surface and capability advertisement match what §12.3 and
§12.4 promise.

Phase 12 — tag commands (§12.3):
- `nuwiki.tags.search` — case-insensitive substring filter over the
  workspace tag index. Returns `[{ name, uri, range, scope, page }]`
  where `scope` is one of `file` / `heading` / `standalone`.
- `nuwiki.tags.generateLinks` — generates/refreshes a tagged-pages
  section. Two modes:
    - `{ uri, tag }` → `= Tag: <name> =` + flat list of `[[Page]]`
      entries for every page tagged with `<name>`.
    - `{ uri }` (no tag) → `= Tags =` umbrella section with `== <tag>
      ==` subgroups, mirroring `:VimwikiGenerateTagLinks` (no arg).
  Idempotent: re-runs replace the existing section by
  case-insensitive heading match.
- `nuwiki.tags.rebuild` — synchronous full re-walk of the wiki root.
  Drops index entries for pages whose files no longer exist on disk,
  re-parses every `.wiki`, and returns `{ pages, files_seen,
  stale_removed }`. Useful for cleaning up after out-of-band edits
  the LSP didn't see.

Ops layer:
- `tag_hits(index, query) → Vec<TagHit>` — pure filter, sorted by
  (name, page, line).
- `tag_pages_snapshot(index) → BTreeMap<tag, [pages]>` — taken under
  the read lock so the dispatcher can release the lock before
  building the edit.
- `build_tag_links_text` / `tag_links_edit` — text-level rendering
  and the WorkspaceEdit producer.

Phase 13 — file-operations capability (§12.4):
- `ServerCapabilities.workspace.file_operations` now advertises
  `did_rename` + `did_delete` with filters scoped to `**/*.wiki`
  and `**/*.md`. (will_* deferred — those return a WorkspaceEdit
  and we'd want to wire them into the rename pipeline before
  promising support.)
- `did_rename_files` handler — moves the live DocumentState forward
  to the new URI when the file was open, then refreshes the index
  (remove old URI, upsert new via read_or_open).
- `did_delete_files` handler — drops both DocumentState and index
  entry so backlink lookups don't surface dangling source URIs.

Tests: 15 new in `phase17_backfill.rs` covering tag hit filtering &
ordering, snapshot dedup, single-tag and full-index render shapes,
edit replace-vs-insert flow, JSON shape of `TagHit`, and the COMMANDS
list. Total 324 tests pass; fmt + clippy clean.

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

nuwiki

A Vim/Neovim plugin providing full vimwiki syntax support, implemented as a Rust-based language server (LSP).

Status: v1.0 (Phases 010) shipped — parsing, highlighting, navigation, editor glue, and release pipeline are all live. v1.1 (Phases 1119) in progress, closing the gap to a full vimwiki replacement: tags, diary, server-side edit commands, link health, HTML export commands, multi-wiki, and the :Vimwiki* keymap layer.

See SPEC.md for the full project specification.

Implementation status

v1.0 — foundation

Phase Name Status
0 Scaffolding done
1 Core AST done
2 Syntax Plugin Interface done
3 Vimwiki Lexer done
4 Vimwiki Parser done
5 Renderer done
6 LSP Foundation done
7 Semantic Tokens done
8 Navigation done
9 Editor Glue done
10 CI/CD release pipeline done

v1.1 — full vimwiki replacement

Phase Name Status
11 Plumbing prerequisites done
12 Tags done
13 Workspace edits + executeCommand done
14 List & table edit commands done (focused subset; table/list-renumber/colorize deferred)
15 Link health + TOC/index generation done
16 Diary done
17 HTML export commands
18 Multi-wiki
19 Editor glue v2 (:Vimwiki* compat, keymaps, text objects, folding)

Repository layout

nuwiki/
├── Cargo.toml              workspace root
├── crates/
│   ├── nuwiki-core/        parser, AST, renderer (no editor deps)
│   ├── nuwiki-lsp/         LSP protocol bridge
│   └── nuwiki-ls/          binary that speaks LSP over stdio
├── plugin/                 universal Vim/Neovim entry point
├── lua/nuwiki/             Neovim Lua glue
├── autoload/nuwiki/        Vim VimL glue
├── ftdetect/               filetype detection for .wiki
├── ftplugin/               per-buffer filetype settings
├── syntax/                 static fallback highlighting
├── doc/                    `:h nuwiki`
├── scripts/                build-time helpers
└── .gitea/workflows/       CI / release pipelines

Building

cargo build --workspace
cargo test  --workspace

MSRV: Rust 1.83.

License

Dual-licensed under either of:

at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work shall be dual licensed as above, without any additional terms or conditions.

S
Description
No description provided
Readme 1.1 MiB
v0.5.2 Latest
2026-07-02 12:02:20 +00:00
Languages
Vim Script 49.1%
Lua 36.7%
Shell 11.2%
HTML 3%