What it does
lsp_ui
LSP UI mount panel — composes the Z.lsp.* widgets with state +
polling + Z.app lifecycle. Mount it from any scene/component to get
a tabbed Diagnostics / Docs / Settings panel that stays fresh on its
own. This is Layer B in the stack: Layer A's widgets stay pure
builders under Z.lsp.*, Layer C (system_tools) embeds those
widgets inside its existing tab strip, and Layer B turns them into a
standalone window with state + polling.
Exports
M.mount(opts: MountOpts?) -> LspUiHandle— mount the panel, return a handle whoseupdate/onCallback/destroy/setVisiblethe caller drives each frame.
Types:
MountOpts = { title: string?, refreshIntervalMs: number?, initialTab: string?, layer: string?, showAsWindow: boolean? }LspUiState = { ...activeTab, diagnostics, summary, namespaces, methods, ... }— the live state map shared betweenupdateandonCallback.LspUiHandle = { state: LspUiState, update: (dt) -> (), onCallback: (id, data) -> boolean, destroy: () -> (), setVisible: (b) -> (), screenName: string }
Usage
local LspUi = require("@builtin::modules.engine.editor.lsp_ui")
local handle = LspUi.mount({
title = "LSP",
refreshIntervalMs = 1000,
initialTab = "diagnostics",
})
-- In your component:
function update(dt) handle.update(dt) end
function onCallback(id, data) return handle.onCallback(id, data) end
function onDestroy() handle.destroy() end
Notes
mountprimes namespaces and strict-mode synchronously so the first frame isn't a blank shell; polling thereafter is gated on the active tab and therefreshIntervalMsclock.showAsWindow = falsereturns the body widget unwrapped — useful when embedding into another panel.- The handle's
statefield is the live reactive state; treat it as opaque except where documented.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.