Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

lsp

LSP composite widgets — pure builders that turn the engine's lsp.* data shapes into widget trees. Six pieces gathered onto a single M table so callers can require the namespace and pick out individual builders. These are stateless: pass data in, get a widget tree out.

Exports

  • M.severitySummary(counts, opts?) -> WidgetNode — hbox of count chips per severity.
  • M.diagnosticsList(diags, onSelect, opts?) -> WidgetNode — scrollable vbox of diagnostic rows.
  • M.diagnosticDetail(diag, opts?) -> WidgetNode — detail panel for one diagnostic.
  • M.docBrowser(state, opts?) -> WidgetNode — namespaces / methods / describe browser.
  • M.strictModeToggle(mode, onChange, opts?) -> WidgetNode — three-button radio.
  • M.directiveBadge(skipMode, opts?) -> WidgetNode? — chip indicating the file's --!skip mode, or nil.

Each export is the builder module's return function(...); see the sibling *.module/README.md files for the per-builder signatures.

Usage

local Z = require("@builtin::modules.zui")
local lsp = require("@builtin::modules.zui.widget.lsp")

return Z.vbox({
    lsp.severitySummary(counts),
    lsp.diagnosticsList(diags, "lsp:row:select"),
    lsp.diagnosticDetail(diags[selectedIndex], { source = source }),
})

Notes

  • Layer B (lsp_ui.module) and Layer C (system_tools' LSP tab) compose these with their own state + polling — but you don't have to: roll your own.
  • Each entry is loaded lazily by require. Hot-reloading any sibling re-imports it on next call.
  • This namespace owns no state. The composite layers above this one do.