Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
with:
components: rustfmt, clippy

- name: Install rust-analyzer
run: rustup component add rust-analyzer

- name: Cache cargo
uses: Swatinem/rust-cache@v2

Expand Down
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 27 additions & 27 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,44 +138,44 @@

---

### 🔴 v0.0.3 — LSP Client Lifecycle
### v0.0.3 — LSP Client Lifecycle
> **Gate:** `initialize` → `initialized` → `shutdown` handshake completes cleanly against `rust-analyzer`

#### `idep-lsp` — Process management
- [ ] Spawn language server subprocess (`Command` + stdio pipes)
- [ ] Capture stdout/stderr separately
- [ ] Graceful shutdown: send `shutdown` request, wait for response, send `exit` notification
- [ ] Force-kill if shutdown times out (configurable, default 5s)
- [ ] Restart policy: exponential backoff, max 3 retries
- [ ] Unit test: mock LSP server, verify lifecycle sequence
- [x] Spawn language server subprocess (`Command` + stdio pipes)
- [x] Capture stdout/stderr separately
- [x] Graceful shutdown: send `shutdown` request, wait for response, send `exit` notification
- [x] Force-kill if shutdown times out (configurable, default 5s)
- [x] Restart policy: exponential backoff, max 3 retries
- [x] Unit test: mock LSP server, verify lifecycle sequence

#### `idep-lsp` — JSON-RPC transport
- [ ] `JsonRpcTransport` struct: read/write over stdio
- [ ] Content-Length header framing (LSP wire format)
- [ ] Async read loop: deserialize incoming messages
- [ ] Outgoing message queue: serialize + write
- [ ] Request ID tracking: match responses to pending requests
- [ ] Notification dispatch: fire-and-forget incoming notifications
- [ ] Unit test: round-trip a request/response pair
- [ ] Unit test: handle malformed message gracefully
- [x] `JsonRpcTransport` struct: read/write over stdio
- [x] Content-Length header framing (LSP wire format)
- [x] Async read loop: deserialize incoming messages
- [x] Outgoing message queue: serialize + write
- [x] Request ID tracking: match responses to pending requests
- [x] Notification dispatch: fire-and-forget incoming notifications
- [x] Unit test: round-trip a request/response pair
- [x] Unit test: handle malformed message gracefully

#### `idep-lsp` — `initialize` handshake
- [ ] Build `InitializeParams` with client capabilities
- [ ] Send `initialize` request
- [ ] Receive and store `InitializeResult` (server capabilities)
- [ ] Send `initialized` notification
- [ ] Store negotiated capabilities for downstream use
- [ ] Integration test: full handshake with `rust-analyzer`
- [x] Build `InitializeParams` with client capabilities
- [x] Send `initialize` request
- [x] Receive and store `InitializeResult` (server capabilities)
- [x] Send `initialized` notification
- [x] Store negotiated capabilities for downstream use
- [x] Integration test: full handshake with `rust-analyzer`

#### WSL2 — LSP path handling
- [ ] URI normalization: convert `file:///mnt/c/...` URIs to WSL-native paths before sending to LSP server
- [ ] URI normalization: convert LSP server responses back to idep-internal paths
- [ ] Unit test: round-trip path conversion for Windows-style and Linux-style paths
- [ ] Integration test: `rust-analyzer` started from WSL2, resolves definition across path boundary
- [x] URI normalization: convert `file:///mnt/c/...` URIs to WSL-native paths before sending to LSP server
- [x] URI normalization: convert LSP server responses back to idep-internal paths
- [x] Unit test: round-trip path conversion for Windows-style and Linux-style paths
- [x] Integration test: `rust-analyzer` started from WSL2, resolves definition across path boundary

#### CI gate
- [ ] Integration test runs `rust-analyzer` in CI (install via `rustup component add rust-analyzer`)
- [ ] Test: initialize → shutdown sequence passes
- [x] Integration test runs `rust-analyzer` in CI (install via `rustup component add rust-analyzer`)
- [x] Test: initialize → shutdown sequence passes

---

Expand Down
4 changes: 4 additions & 0 deletions idep-lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ serde.workspace = true
serde_json.workspace = true
lsp-types.workspace = true
jsonrpc-core.workspace = true
lsp-server = "0.7"
crossbeam-channel = "0.5"
idep-ai = { path = "../idep-ai" }
url = "2.5"

[dev-dependencies]
tokio = { version = "1", features = ["full", "test-util"] }
tempfile = "3"
Empty file removed idep-lsp/src/.gitkeep
Empty file.
Loading
Loading