AtlatestRepositorysigil-lsp
1
# sigil-lsp3
Language Server Protocol implementation for4
[Sigil](https://codeberg.org/sigil/sigil). Provides diagnostics, hover,5
completion, go-to-definition, formatting, and code actions for Sigil6
source files, exposed over LSP 3.17 / JSON-RPC 2.0 on stdio.8
Invoked by editors through `sigil lsp serve` (registered as a9
subcommand of sigil-cli).11
## Modules13
| 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
## Usage31
```scheme32
(import (sigil lsp))33
(lsp-serve)34
(lsp-serve log-file: "/tmp/sigil-lsp.log" log-level: 'debug)35
```37
Or from the command line via sigil-cli:39
```40
sigil lsp serve41
sigil lsp serve --log-file /tmp/sigil-lsp.log --log-level debug42
```44
## Build and test46
```47
sigil deps install48
sigil build49
sigil test --report50
```52
Local development against an unreleased sigil monorepo:54
```55
sigil deps install --redirects ./dev-redirects.sgl56
sigil build --redirects ./dev-redirects.sgl57
```59
## License61
BSD-3-Clause. See `LICENSE` in the sigil monorepo for the canonical copy.