nika-lsp-0.47.1 is not a library.
nika-lsp
Language Server Protocol (LSP) implementation for Nika YAML workflows.
Features
- Syntax Validation — Real-time YAML validation for
.nika.yamlworkflows - Autocompletion — 5 semantic verbs (
infer,exec,fetch,invoke,agent) - MCP Tool Discovery — Completion for available MCP tools
- Task Dependency Validation — Validates
with:references and DAG structure - Template Variable Completion —
{{with.*}}and{{inputs.*}}variables - Go-to-Definition — Navigate to task definitions
- Hover Documentation — Inline docs for verbs and parameters
- Diagnostics — NIKA error codes with actionable suggestions
Installation
From crates.io (recommended)
From Homebrew
From source
Verify installation
Editor Setup
VS Code
- Install the YAML extension
- Add to your
settings.json:
-
Configure the LSP in VS Code:
- Install LSP client extension or configure manually
- Add nika-lsp as a custom language server
Neovim (nvim-lspconfig)
Add to your Neovim configuration:
local lspconfig = require
local configs = require
-- Define nika-lsp if not already defined
if not configs.
-- Enable nika-lsp
lspconfig..
Helix
Add to ~/.config/helix/languages.toml:
[[]]
= "yaml"
= ["nika-lsp", "yaml-language-server"]
[]
= "nika-lsp"
Zed
Add to your Zed settings:
Sublime Text (LSP package)
Add to LSP settings:
Emacs (lsp-mode)
Add to your Emacs configuration:
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-language-id-configuration
'(yaml-mode . "yaml"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("nika-lsp"))
:activation-fn (lsp-activate-on "yaml")
:server-id 'nika-lsp)))
Usage
The LSP server starts automatically when your editor opens a .nika.yaml file. Features include:
Completions
Type a verb and get intelligent suggestions:
tasks:
- id: my_task
# Type 'inf' and get 'infer:' completion with documentation
Diagnostics
Get real-time error feedback:
tasks:
- id: task1
with:
data: nonexistent_task # Error: Unknown task 'nonexistent_task'
infer: "Process {{with.data}}"
Hover Documentation
Hover over verbs for inline documentation:
tasks:
- id: research
agent: # Hover for: "Multi-turn agentic loop with MCP tools"
prompt: "Research AI papers"
Configuration
The LSP respects the following settings (when supported by your editor):
| Setting | Default | Description |
|---|---|---|
nika.validation.enabled |
true |
Enable/disable validation |
nika.completion.providers |
true |
Show provider completions |
nika.completion.mcpTools |
true |
Show MCP tool completions |
nika.diagnostics.delay |
300 |
Debounce delay in ms |
Supported Schema Versions
nika/workflow@0.12(current)nika/workflow@0.11nika/workflow@0.10nika/workflow@0.9nika/workflow@0.8nika/workflow@0.5nika/workflow@0.3
Development
# Build
# Test
# Run with logging
RUST_LOG=debug
Architecture
nika-lsp/
├── src/
│ ├── main.rs # LSP server entry point
│ ├── backend.rs # Language server implementation
│ ├── completion.rs # Completion provider
│ ├── diagnostics.rs # Validation diagnostics
│ ├── hover.rs # Hover documentation
│ └── document.rs # Document management
└── Cargo.toml
The LSP integrates with the main nika crate for:
- AST parsing — Uses
nika::ast::parse_yaml()for accurate parsing - Validation — Leverages
nika::analyzerfor semantic validation - Error codes — Surfaces NIKA-xxx error codes with fix suggestions
Related
- nika — Main CLI and runtime
- nika.sh — Documentation
- JSON Schema — Workflow schema
License
MIT License — see LICENSE for details.