1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//! Language Server Protocol support for Nika workflows
//!
//! This module implements LSP for `.nika.yaml` files, providing:
//! - Real-time diagnostics via Two-Phase IR (RawWorkflow → AnalyzedWorkflow)
//! - Schema-aware completions for verbs, fields, and bindings
//! - Hover documentation for task definitions
//! - Go-to-definition for task references and bindings
//! - Code actions for common fixes
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────────┐
//! │ VS Code / Editor │
//! │ │ │
//! │ │ LSP Protocol (JSON-RPC over stdio) │
//! │ ▼ │
//! │ ┌─────────────────────────────────────────────────────────┐ │
//! │ │ NikaLanguageServer │ │
//! │ │ ├── did_open/did_change → parse + validate + diagnostics│ │
//! │ │ ├── completion → schema-aware suggestions │ │
//! │ │ ├── hover → documentation on hover │ │
//! │ │ └── goto_definition → jump to task/binding │ │
//! │ └─────────────────────────────────────────────────────────┘ │
//! │ │ │
//! │ ▼ │
//! │ ┌─────────────────────────────────────────────────────────┐ │
//! │ │ Two-Phase IR (ast module) │ │
//! │ │ ├── raw::parse() → RawWorkflow with Spans │ │
//! │ │ └── analyzer::analyze() → AnalyzedWorkflow + Errors │ │
//! │ └─────────────────────────────────────────────────────────┘ │
//! └─────────────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Usage
//!
//! ```bash
//! # Start LSP server (stdio transport)
//! nika lsp
//!
//! # VS Code settings.json
//! {
//! "nika.lsp.path": "/path/to/nika"
//! }
//! ```
pub use ;
pub use server_capabilities;
pub use ;
pub use DocumentStore;
pub use NikaLanguageServer;
/// Start the LSP server with stdio transport
///
/// This is the main entry point called by `nika lsp`.
pub async