Documentation
¶
Overview ¶
Package lsp implements a tiny Language Server Protocol server for MX Script. It speaks JSON-RPC 2.0 over stdio and exposes:
- textDocument/didOpen, didChange, didClose, didSave — track buffers
- textDocument/publishDiagnostics — parse errors as squiggles
- textDocument/formatting — invoke mx fmt
- textDocument/hover — minimal "did you mean ___" for builtins
Usage from VS Code (or any LSP client):
{
"command": "mx",
"args": ["lsp"],
"filetypes": ["mxscript"]
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllDocNames ¶ added in v0.84.0
func AllDocNames() []string
AllDocNames returns every name in the curated docs table, sorted. Used by `mx help` listing mode and `mx help <topic>`'s "did you mean" hint when the topic isn't found exactly.
func LookupDoc ¶ added in v0.84.0
LookupDoc returns the signature and summary for a known builtin or namespace key (e.g. "json_stringify", "ai.complete"). Returns "", "", false when the name isn't in the curated docs table — callers can then decide whether to suggest something close or to print a generic "no docs" message.
Types ¶
type UserSymbol ¶ added in v1.5.0
UserSymbol is one declaration extracted from an open document. Surfaces in completion results so editors offer the user's own names alongside builtins.