dlm-lsp
Language Server Protocol backend for .dlm files.
Features
- Completions — base model registry keys, frontmatter fields, section fences with snippets
- Hover — base model specs (params, size, context, license), section fence info
- Diagnostics — schema validation errors, unknown base models, frontmatter structure
- Code Actions — schema migration, base model fixes
Install
pip install dlm-lsp
This pulls document-language-model from PyPI as a runtime dependency.
Compatibility
dlm-lsp |
document-language-model |
|---|---|
0.1.x |
0.10.x |
The LSP imports from dlm.doc.parser, dlm.doc.schema, dlm.base_models,
and dlm.store.manifest. A major-version drift on either side can break
imports or schema validation. The LSP logs both versions at startup
(visible in your editor's LSP log channel) so mismatches surface
immediately. Pin a matching pair if you mix custom forks.
Usage
The dlm-lsp binary launches a Language Server over stdio:
dlm-lsp
VSCode, Neovim, Helix, and Zed can connect to it as an LSP server for .dlm files.
Development
uv sync --dev
uv run pytest tests/
uv run mypy src/dlm_lsp
uv run ruff check .
View source
| 1 | # dlm-lsp |
| 2 | |
| 3 | Language Server Protocol backend for `.dlm` files. |
| 4 | |
| 5 | ## Features |
| 6 | |
| 7 | - **Completions** — base model registry keys, frontmatter fields, section fences with snippets |
| 8 | - **Hover** — base model specs (params, size, context, license), section fence info |
| 9 | - **Diagnostics** — schema validation errors, unknown base models, frontmatter structure |
| 10 | - **Code Actions** — schema migration, base model fixes |
| 11 | |
| 12 | ## Install |
| 13 | |
| 14 | ```bash |
| 15 | pip install dlm-lsp |
| 16 | ``` |
| 17 | |
| 18 | This pulls `document-language-model` from PyPI as a runtime dependency. |
| 19 | |
| 20 | ## Compatibility |
| 21 | |
| 22 | | `dlm-lsp` | `document-language-model` | |
| 23 | | :-- | :-- | |
| 24 | | `0.1.x` | `0.10.x` | |
| 25 | |
| 26 | The LSP imports from `dlm.doc.parser`, `dlm.doc.schema`, `dlm.base_models`, |
| 27 | and `dlm.store.manifest`. A major-version drift on either side can break |
| 28 | imports or schema validation. The LSP logs both versions at startup |
| 29 | (visible in your editor's LSP log channel) so mismatches surface |
| 30 | immediately. Pin a matching pair if you mix custom forks. |
| 31 | |
| 32 | ## Usage |
| 33 | |
| 34 | The `dlm-lsp` binary launches a Language Server over stdio: |
| 35 | |
| 36 | ```bash |
| 37 | dlm-lsp |
| 38 | ``` |
| 39 | |
| 40 | VSCode, Neovim, Helix, and Zed can connect to it as an LSP server for `.dlm` files. |
| 41 | |
| 42 | ## Development |
| 43 | |
| 44 | ```bash |
| 45 | uv sync --dev |
| 46 | uv run pytest tests/ |
| 47 | uv run mypy src/dlm_lsp |
| 48 | uv run ruff check . |
| 49 | ``` |