How the atopile Language Server works (pygls), how it builds per-document graphs for completion/hover/defs, and the invariants for keeping it fast and crash-proof.
The lsp module (located in src/atopile/lsp/) implements the Language Server Protocol for atopile. It provides IDE features like autocomplete, go-to-definition, and diagnostics (error reporting) for ato files.
Run the server on stdio (what editors expect):
python -m atopile.lsp.lsp_server
src/atopile/lsp/lsp_server.py
LSP_SERVER (pygls LanguageServer)DocumentState (graph/typegraph/build_result)src/atopile/lsp/lsp_utils.pysrc/atopile/lsp/_debug_server.pyGraphView + TypeGraph stored in DocumentState.BuildFileResult to power completion/hover even when the current edit has errors.src/atopile/lsp/lsp_server.py.ato dev test --llm test/test_lsp_completion.py -qDocumentState.reset_graph calls GraphView.destroy()).