Remove Rust code, delegate server to nuwiki-rs repo
CI / cargo clippy (pull_request) Failing after 42s
CI / cargo fmt --check (pull_request) Failing after 45s
CI / cargo test (pull_request) Failing after 49s
CI / editor keymaps (pull_request) Has been skipped

Delete all Rust crates (crates/) and Cargo files. The nuwiki-ls binary
is now built in the separate nuwiki-rs repository and downloaded at
install time from the Gitea release assets, with a cargo build fallback
that clones nuwiki-rs.

Update all documentation to reflect the split repo layout.
This commit is contained in:
gffranco
2026-06-24 12:57:15 +00:00
parent 0df72e52ea
commit cb11889e72
81 changed files with 234 additions and 26425 deletions
+19 -46
View File
@@ -6,16 +6,12 @@ For day-one setup see [ONBOARDING.md](ONBOARDING.md); for user-facing help see
nuwiki is a vimwiki-compatible Vim/Neovim plugin backed by a Rust language
server. The editor layers are thin clients; all parsing, navigation, and
editing logic lives in the Rust crates and is reached over LSP.
editing logic lives in the [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs)
repository and is reached over LSP.
| Property | Value |
|---|---|
| License | Dual MIT / Apache-2.0 |
| MSRV | Rust 1.83 |
| Edition / resolver | 2021 / v2 |
| Repo | `https://code.gfran.co/gffranco/nuwiki` |
| VCS / CI | Gitea + Gitea Actions |
| LSP library | `tower-lsp` (tokio, stdio transport) |
| Min editors | Neovim 0.11+, Vim 9.1+ |
---
@@ -28,42 +24,21 @@ editing logic lives in the Rust crates and is reached over LSP.
Editor client (VimL / Lua) — pure wiring, no logic
│ LSP over stdio
nuwiki-lsp — protocol bridge, executeCommand, document store, config
nuwiki-core — lexer → parser → AST → renderer (no editor deps)
nuwiki-ls (nuwiki-rs) — Rust LSP server: protocol bridge, executeCommand,
document store, config, parser, renderer
```
### Crate dependency rules
> The Rust LSP server is in the separate [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs)
> repository. This plugin repo is the Vim/Neovim client layer only.
>
> The architecture table below is for reference — the Rust source lives in nuwiki-rs.
```
nuwiki-ls → nuwiki-lsp → nuwiki-core
```
- `nuwiki-core` never depends on `nuwiki-lsp` / `nuwiki-ls`.
- `nuwiki-lsp` never depends on `nuwiki-ls`.
- The VimL and Lua layers contain no logic — every command body issues a
`workspace/executeCommand` or a built-in LSP request.
### Repository layout
```
crates/
nuwiki-core/ # parser, AST, renderer — editor-independent
src/
ast/ # block.rs inline.rs link.rs span.rs visit.rs
syntax/ # registry.rs + vimwiki/{lexer,parser}.rs
render/ # html.rs
date.rs # diary period math (no chrono dependency)
nuwiki-lsp/ # LSP backend
src/
lib.rs # Backend, capabilities, textDocument handlers
commands.rs # executeCommand dispatcher + pure edit ops
config.rs # Config / WikiConfig / HtmlConfig
diagnostics.rs index.rs nav.rs rename.rs semantic_tokens.rs
diary.rs export.rs edits.rs folding.rs wiki.rs
nuwiki-ls/ # thin binary: starts the stdio server
plugin/nuwiki.vim # universal entry point (detects Vim vs Neovim)
lua/nuwiki/ # Neovim layer: init, config, lsp, keymaps, commands,
# folding, install
@@ -72,12 +47,15 @@ ftdetect/ ftplugin/ syntax/ # filetype detection, buffer setup, fallback HL
doc/nuwiki.txt # :help
scripts/download_bin.vim # plugin-runtime binary download (build hooks)
development/ # dev-only tooling + this document (not shipped)
.gitea/workflows/ # ci.yaml, release.yaml
```
---
## 2. nuwiki-core
## 2. nuwiki-core (nuwiki-rs)
> This section documents the Rust server's internals — the source lives in
> the [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) repository. Kept
> here as a technical reference for the LSP protocol contract.
### AST
@@ -199,9 +177,8 @@ raw and external URLs are never diagnosed.
Pre-built binaries are published as Gitea release assets
(`nuwiki-ls-{version}-{target}.tar.gz`) and fetched at install time by
`lua/nuwiki/install.lua` (Neovim) or `scripts/download_bin.vim` (Vim build
hooks), installed to `{plugin_dir}/bin/nuwiki-ls`. Falls back to
`cargo build --release` when download fails or
`g:nuwiki_build_from_source = 1`.
hooks), installed to `{plugin_dir}/bin/nuwiki-ls`. The binary is downloaded
from the [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) releases.
`plugin/nuwiki.vim` dispatches: Neovim → `require('nuwiki').setup()`; Vim →
`nuwiki#lsp#start()` (prefers `vim-lsp`, falls back to `coc.nvim`). On Neovim
@@ -323,16 +300,12 @@ provides a no-LSP fallback):
| Job | Command |
|---|---|
| fmt | `cargo fmt --all -- --check` |
| clippy | `cargo clippy --workspace --all-targets -- -D warnings` |
| test | `cargo test --workspace --all-targets` |
| keymaps | `development/tests/test-keymaps.sh` (Neovim 0.11) + `test-keymaps-vim.sh` (Vim) |
| calendar | `development/tests/test-calendar.sh` (Neovim) + `test-calendar-vim.sh` (Vim) |
`.gitea/workflows/release.yaml` triggers on `v*` tags: cross-compiles the four
Linux targets (gnu/musl × x86_64/aarch64) via `cross`, packages `.tar.gz`, and
creates a Gitea release using `RELEASE_TOKEN`. macOS and Windows binaries are
built manually and attached to the same release. crates.io publishing is not
wired up.
`.gitea/workflows/release.yaml` (in [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs))
triggers on `v*` tags: cross-compiles the four Linux targets (gnu/musl × x86_64/aarch64)
via `cross`, packages `.tar.gz`, and creates a Gitea release using `RELEASE_TOKEN`.
A change is semver-breaking if it alters `nuwiki-core` AST nodes, the
`SyntaxPlugin`/`Renderer` traits, the user-config schema, or removes an LSP