AtlatestRepositorysigil-lsp
1# sigil-lsp
2
3Language Server Protocol implementation for
4[Sigil](https://codeberg.org/sigil/sigil). Provides diagnostics, hover,
5completion, go-to-definition, formatting, and code actions for Sigil
6source files, exposed over LSP 3.17 / JSON-RPC 2.0 on stdio.
7
8Invoked by editors through `sigil lsp serve` (registered as a
9subcommand of sigil-cli).
11## Modules
13| Module | Purpose |
14|-------------------------------|-------------------------------------------------|
15| `(sigil lsp)` | Top-level `lsp-serve` entry point |
16| `(sigil lsp server)` | Server loop and method dispatch |
17| `(sigil lsp protocol)` | JSON-RPC 2.0 framing and message shapes |
18| `(sigil lsp documents)` | In-memory document cache keyed by URI |
19| `(sigil lsp positions)` | 0-based line/character helpers |
20| `(sigil lsp diagnostics)` | Parse errors + lint warnings as LSP diagnostics |
21| `(sigil lsp hover)` | Hover provider via `(sigil docs)` |
22| `(sigil lsp completion)` | Completion provider via `(sigil docs)` |
23| `(sigil lsp definition)` | Go-to-definition via module resolution |
24| `(sigil lsp formatting)` | Document and range formatting via `(sigil format)` |
25| `(sigil lsp code-actions)` | Quick-fix code actions (import, unused import) |
26| `(sigil lsp lint)` | Lint warnings carrying source positions |
27| `(sigil lsp commands)` | `sigil lsp` CLI subcommand registration |
29## Usage
31```scheme
32(import (sigil lsp))
33(lsp-serve)
34(lsp-serve log-file: "/tmp/sigil-lsp.log" log-level: 'debug)
35```
37Or from the command line via sigil-cli:
39```
40sigil lsp serve
41sigil lsp serve --log-file /tmp/sigil-lsp.log --log-level debug
42```
44## Build and test
46```
47sigil deps install
48sigil build
49sigil test --report
50```
52Local development against an unreleased sigil monorepo:
54```
55sigil deps install --redirects ./dev-redirects.sgl
56sigil build --redirects ./dev-redirects.sgl
57```
59## License
61BSD-3-Clause. See `LICENSE` in the sigil monorepo for the canonical copy.