Minimal Language Server Protocol implementation for GNN files. Provides real-time diagnostics and hover information in editors that support LSP (VS Code, Neovim, etc.).
Requires: pygls package (pip install pygls)
| Feature | LSP Method | Description |
|---|---|---|
| Diagnostics on open | textDocument/didOpen |
Validates sections, state-space, and connections |
| Diagnostics on save | textDocument/didSave |
Re-validates after changes |
| Hover info | textDocument/hover |
Shows variable dimensions and type on hover |
# Start via CLI
gnn lsp
# Or directly
python -m src.lspAdd to .vscode/settings.json:
{
"gnn-lsp.server.path": "gnn",
"gnn-lsp.server.args": ["lsp"]
}- Server: Built on
pygls(Python Language Server framework) - Validation: Delegates to
gnn.schema(same validation asgnn validate) - Hover: Parses state-space to show variable metadata at cursor position
- Fallback: Graceful degradation when
pyglsis not installed
lsp/
├── __init__.py # Server implementation (226 lines)
├── AGENTS.md # Agent documentation
├── README.md # This file
└── SPEC.md # Module specification