Архитектура Language Server для atopile

engineering

lsp is a Claude Code skill that explains how the atopile Language Server Protocol implementation works: the pygls server architecture, per-document graph construction, and the invariants that keep it fast and crash-proof. The server lives in `src/atopile/lsp/lsp_server.py` and provides autocomplete, go-to-definition, hover, and diagnostics for `.ato` files, with the VSCode extension as its primary client. A core design constraint is partial compilation — the server must handle syntax errors, incomplete typegraphs, and linking exceptions without crashing, while meeting strict latency targets (<50ms for typing, <200ms for completion). The skill covers `DocumentState` lifecycle, the "keep last good build" strategy for powering features during edits, debouncing, and mandatory `GraphView.destroy()` calls on rebuild. It is the reference for anyone developing or debugging atopile IDE features and LSP handlers.