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.

SettingPurposeDefaultRange
portTCP port. Without it, the first free port from 1980 up. With 0, the system selects a free port.19800–65,535
hostIP address to bind.127.0.0.1IP address
port-fileFile that receives the bound port.nonepath

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:

TRON142 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
044C 706F7274txt "port"
0902 BC070000000000 00i64 1980
120F 0A 04000000 0900 0000map leaf, size 10: @4 → @9
1C2C 696Ftxt "io"
1F09bit true
200F 0A 1C000000 1F00 0000map leaf, size 10: @1C → @1F
2A3C 6C7370txt "lsp"
2E0F 0A 2A000000 1200 0000map leaf, size 10: @2A → @12
386C 7374646C6962txt "stdlib"
3F09bit true
400F 0A 38000000 3F00 0000map leaf, size 10: @38 → @3F
4A8C 64617461626173 65txt "database"
5309bit true
540F 0A 4A000000 5300 0000map leaf, size 10: @4A → @53
5E07 16 041A0000 2000 0000 2E000000 4000 0000 54000000map branch, size 22, depth 0 (root), slots 2, 9, 11, 12: @20 → @2E → @40 → @54
747C 706C7567696E73txt "plugins"
7C0F 0A 74000000 5E00 0000map leaf, size 10: @74 → @5E

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.