Remove Rust code, delegate server to nuwiki-rs repo
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:
+44
-90
@@ -4,41 +4,12 @@
|
||||
|
||||
nuwiki is a vimwiki-compatible Vim/Neovim plugin backed by a Rust language server. It provides full vimwiki syntax support while keeping the original file format, keymaps, and command surface intact. The substantive work happens in a Rust LSP daemon — Vim and Neovim are thin client layers that wire up keystrokes and display results.
|
||||
|
||||
The Rust LSP server lives in the separate [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) repository. This plugin repo is the Vim/Neovim client layer and is distributed independently from the server binary.
|
||||
|
||||
## Repository Structure
|
||||
|
||||
```
|
||||
nuwiki/
|
||||
├── Cargo.toml # Rust workspace root
|
||||
├── Cargo.lock
|
||||
├── crates/
|
||||
│ ├── nuwiki-ls/ # Binary crate — thin main.rs, starts stdio LSP server
|
||||
│ │ ├── Cargo.toml
|
||||
│ │ └── src/main.rs
|
||||
│ │
|
||||
│ ├── nuwiki-core/ # Library crate — parser, AST, renderer (no editor deps)
|
||||
│ │ ├── Cargo.toml
|
||||
│ │ └── src/
|
||||
│ │ ├── lib.rs
|
||||
│ │ ├── syntax/ # Syntax plugins (vimwiki, future markdown)
|
||||
│ │ │ ├── mod.rs
|
||||
│ │ │ ├── registry.rs
|
||||
│ │ │ └── vimwiki/
|
||||
│ │ │ ├── mod.rs
|
||||
│ │ │ ├── lexer.rs
|
||||
│ │ │ └── parser.rs
|
||||
│ │ ├── ast/ # Abstract Syntax Tree node definitions
|
||||
│ │ │ ├── mod.rs
|
||||
│ │ │ ├── block.rs
|
||||
│ │ │ ├── inline.rs
|
||||
│ │ │ └── link.rs
|
||||
│ │ └── render/ # Renderers (HTML, etc.)
|
||||
│ │ ├── mod.rs
|
||||
│ │ └── html.rs
|
||||
│ │
|
||||
│ └── nuwiki-lsp/ # Library crate — LSP protocol bridge
|
||||
│ ├── Cargo.toml
|
||||
│ └── src/lib.rs
|
||||
│
|
||||
├── plugin/ # Universal Vim/Neovim entry point
|
||||
│ └── nuwiki.vim
|
||||
│
|
||||
@@ -47,7 +18,7 @@ nuwiki/
|
||||
│ ├── init.lua
|
||||
│ ├── config.lua
|
||||
│ ├── lsp.lua
|
||||
│ └── install.lua # Binary download / build-from-source logic
|
||||
│ └── install.lua # Binary download logic
|
||||
│
|
||||
├── autoload/ # Lazy-loaded VimL (Vim compat layer)
|
||||
│ └── nuwiki/
|
||||
@@ -92,26 +63,21 @@ nuwiki/
|
||||
└── release.yaml # Cross-compile + release on v* tag
|
||||
```
|
||||
|
||||
## Key Crates
|
||||
## Server Component
|
||||
|
||||
1. **nuwiki-core**: Contains the parser, lexer, AST, and renderer. This is the pure-Rust core with no editor dependencies.
|
||||
2. **nuwiki-lsp**: Bridges the core to the LSP protocol using tower-lsp. Handles LSP requests/responses and manages the document store.
|
||||
3. **nuwiki-ls**: Binary crate that starts the stdio LSP server. Very thin — just initializes the LSP server and runs it.
|
||||
The Rust LSP server (`nuwiki-ls`) lives in the separate [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) repository. Pre-built binaries are downloaded automatically by the plugin's `install()` function. To build from source:
|
||||
|
||||
```bash
|
||||
git clone https://code.gfran.co/gffranco/nuwiki-rs
|
||||
cd nuwiki-rs
|
||||
cargo build --release -p nuwiki-ls
|
||||
```
|
||||
|
||||
## Build & Installation
|
||||
|
||||
### Prerequisites
|
||||
- Rust toolchain (1.83+ stable)
|
||||
- Cargo
|
||||
- For editor integration: Vim 9+ or Neovim 0.5+ with an LSP client (vim-lsp recommended for Vim, built-in for Neovim 0.11+)
|
||||
|
||||
### Development Build
|
||||
```bash
|
||||
# From the repository root
|
||||
cargo build --release -p nuwiki-ls # Builds the LSP binary
|
||||
```
|
||||
|
||||
The binary will be placed at `target/release/nuwiki-ls`.
|
||||
- The `nuwiki-ls` binary is downloaded automatically; no Rust toolchain required unless building from source
|
||||
|
||||
### Installation via Plugin Managers
|
||||
|
||||
@@ -143,37 +109,34 @@ call dein#add('gffranco/nuwiki', {
|
||||
```bash
|
||||
git clone https://code.gfran.co/gffranco/nuwiki ~/.vim/pack/gffranco/start/nuwiki
|
||||
cd ~/.vim/pack/gffranco/start/nuwiki
|
||||
cargo build --release -p nuwiki-ls
|
||||
mkdir -p bin && ln -s ../target/release/nuwiki-ls bin/nuwiki-ls
|
||||
vim -e -s -c "source scripts/download_bin.vim" -c "q"
|
||||
```
|
||||
|
||||
Plain Vim users also need an LSP client — vim-lsp is recommended.
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Testing
|
||||
```bash
|
||||
# Run all tests (workspace)
|
||||
cargo test --workspace
|
||||
### Testing (Editor Layer)
|
||||
|
||||
# Run tests for a specific crate
|
||||
cargo test -p nuwiki-core
|
||||
cargo test -p nuwiki-lsp
|
||||
cargo test -p nuwiki-ls
|
||||
```bash
|
||||
# Run editor tests (shell + Lua harnesses in development/tests/)
|
||||
./development/tests/test-keymaps.sh
|
||||
./development/tests/test-calendar.sh
|
||||
```
|
||||
|
||||
### Linting & Formatting
|
||||
```bash
|
||||
# Check formatting
|
||||
cargo fmt -- --check
|
||||
For Rust-level tests, see the [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) repository:
|
||||
|
||||
# Run Clippy
|
||||
```bash
|
||||
# In the nuwiki-rs repo
|
||||
cargo test --workspace
|
||||
cargo clippy --workspace -- -D warnings
|
||||
```
|
||||
|
||||
### Running the LSP Server Manually (for debugging)
|
||||
|
||||
Build from [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) and run:
|
||||
|
||||
```bash
|
||||
# Build and run the binary
|
||||
cargo run -p nuwiki-ls -- --help
|
||||
```
|
||||
|
||||
@@ -210,44 +173,35 @@ This verifies:
|
||||
|
||||
## Important Notes
|
||||
|
||||
- The core library (`nuwiki-core`) is completely editor-agnostic and can be tested independently.
|
||||
- The LSP layer (`nuwiki-lsp`) depends only on the core and tower-lsp.
|
||||
- The binary crate (`nuwiki-ls`) is intentionally thin — it just initializes and runs the LSP server.
|
||||
- The Rust LSP server is in the separate [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) repository.
|
||||
- This plugin repo contains only the editor client layer (VimL/Lua).
|
||||
- Editor layers (VimL/Lua) contain zero logic — they are pure wiring only.
|
||||
- All syntax-specific code lives in `nuwiki-core/src/syntax/<syntax>/` making it easy to add new syntaxes (e.g., markdown) in the future.
|
||||
- The project uses a workspace Cargo.toml with resolver v2 (edition 2021).
|
||||
- All syntax-specific code lives in the Rust LSP server's `nuwiki-core` crate.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://code.gfran.co/gffranco/nuwiki
|
||||
cd nuwiki
|
||||
```
|
||||
1. Clone this plugin repository:
|
||||
```bash
|
||||
git clone https://code.gfran.co/gffranco/nuwiki
|
||||
cd nuwiki
|
||||
```
|
||||
|
||||
2. Build the LSP binary:
|
||||
```bash
|
||||
cargo build --release -p nuwiki-ls
|
||||
```
|
||||
2. Install the plugin in your Neovim/Vim configuration using your preferred plugin manager (see above examples). The `nuwiki-ls` binary will be downloaded automatically.
|
||||
|
||||
3. Set up a test wiki directory:
|
||||
```bash
|
||||
mkdir -p ~/test-wiki
|
||||
echo "# Test Wiki" > ~/test-wiki/index.wiki
|
||||
```
|
||||
3. Open a .wiki file and verify:
|
||||
- Syntax highlighting works
|
||||
- `:VimwikiIndex` opens the index page
|
||||
- LSP features (go-to-definition, hover, completions) work via `:checkhealth nuwiki`
|
||||
|
||||
4. Install the plugin in your Neovim/Vim configuration using your preferred plugin manager (see above examples).
|
||||
|
||||
5. Open a .wiki file and verify:
|
||||
- Syntax highlighting works
|
||||
- `:VimwikiIndex` opens the index page
|
||||
- LSP features (go-to-definition, hover, completions) work via `:checkhealth nuwiki`
|
||||
To modify the LSP server itself, clone the [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) repository and build the binary from source.
|
||||
|
||||
## CI/CD
|
||||
|
||||
The project uses Gitea Actions:
|
||||
- CI (`.gitea/workflows/ci.yaml`): Runs on every push/PR — checks formatting, Clippy, and runs tests.
|
||||
- Release (`.gitea/workflows/release.yaml`): Triggers on `v*` tag — cross-compiles for Linux targets and creates a Gitea release.
|
||||
This repo (editor client) uses Gitea Actions:
|
||||
- CI (`.gitea/workflows/ci.yaml`): Runs editor tests on every push/PR.
|
||||
|
||||
The Rust LSP server lives in [nuwiki-rs](https://code.gfran.co/gffranco/nuwiki-rs) which handles:
|
||||
- Release (`.gitea/workflows/release.yaml`): Triggers on `v*` tag — cross-compiles for Linux targets and creates a Gitea release with downloadable binaries.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user