Editor integration: lsp
lsp serves the Language Server Protocol 3.17 over TCP while the database is
open. An editor or an agent connects to the port. There is no server program.
Select io as well.
| Setting | Purpose | Default | Range |
|---|---|---|---|
port | TCP port. Without it, the first free port from 1980 up. With 0, the system selects a free port. | 1980 | 0–65,535 |
host | IP address to bind. | 127.0.0.1 | IP address |
port-file | File that receives the bound port. | none | path |
The socket has no authentication. A peer that connects can evaluate code and write the database with the access of the process that opened it. When the database opens, it writes a warning to standard error. Bind to a loopback address if the network is not trusted.
Dependencies
- Requires
io
Configuration
Select this plugin explicitly when opening the database:
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 706F7274 | txt "port" |
| 09 | 02 BC070000000000 00 | i64 1980 |
| 12 | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 1C | 2C 696F | txt "io" |
| 1F | 09 | bit true |
| 20 | 0F 0A 1C000000 1F00 0000 | map leaf, size 10: @1C → @1F |
| 2A | 3C 6C7370 | txt "lsp" |
| 2E | 0F 0A 2A000000 1200 0000 | map leaf, size 10: @2A → @12 |
| 38 | 6C 7374646C6962 | txt "stdlib" |
| 3F | 09 | bit true |
| 40 | 0F 0A 38000000 3F00 0000 | map leaf, size 10: @38 → @3F |
| 4A | 8C 64617461626173 65 | txt "database" |
| 53 | 09 | bit true |
| 54 | 0F 0A 4A000000 5300 0000 | map leaf, size 10: @4A → @53 |
| 5E | 07 16 041A0000 2000 0000 2E000000 4000 0000 54000000 | map branch, size 22, depth 0 (root), slots 2, 9, 11, 12: @20 → @2E → @40 → @54 |
| 74 | 7C 706C7567696E73 | txt "plugins" |
| 7C | 0F 0A 74000000 5E00 0000 | map leaf, size 10: @74 → @5E |
| 86 | 7C000000 00000000 | root → @7C; previous: none |
Usage
Connect the editor to the port. Without port, the plugin uses 1980, or the
next free port when a different process uses 1980. A configured port that
is in use refuses the open. The startup warning, stardust/status and
port-file give the bound port. The plugin sends each database operation as
an ordinary request, with the same workers, sessions and request capacity as
the host. When every request slot is busy, an editor request waits in the
plugin and runs when a slot becomes free. Waiting database operations start
in the order that they were queued. Each ready operation of a multi-step
command joins the end of that queue. A request can wait for as long as every
slot stays busy, for example while live queries hold all the slots. $/cancelRequest or the end of the
connection removes a waiting request.
stardust/status reports the port and the open connections.