A compatibility layer aimed at redefining the user widget API in terms of modules and components. New features:
- component props have Lean types
- props can be RpcEncodable
- we distinguish between an arbitrary 'widget module' (any ES module) and a 'widget component', that is a module which can be rendered
- moreover only 'panel widget components' can appear as top-level panels in the infoview
TODO: If the design works out, it could replace the current Lean core definitions.
Equations
Instances For
Equations
- ProofWidgets.instRpcEncodableLazyEncodableJson = { rpcEncode := fun fn => fn, rpcDecode := fun j => pure (pure j) }
- lctx : Lean.LocalContext
- expr : Lean.Expr
Instances For
Equations
- ProofWidgets.ExprWithCtx.runMetaM e x = Lean.Elab.ContextInfo.runMetaM e.ci e.lctx (x e.expr)
Instances For
Equations
- ProofWidgets.ExprWithCtx.save e = do let __do_lift ← Lean.Elab.ContextInfo.save let __do_lift_1 ← Lean.getLCtx pure { ci := __do_lift, lctx := __do_lift_1, expr := e }
Instances For
Derive Lean.Server.RpcEncodable
for a type.
HACK: around https://leanprover.zulipchat.com/#narrow/stream/341532-lean4-dev/topic/Should.20instance.20names.20inherit.20macro.20scopes.3F
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProofWidgets.widgetDefPostfix = `_userWidgetDef
Instances For
- javascript : String
A JS module intended for use in user widgets.
To initialize this field from an external JS file, use
include_str "path"/"to"/"file.js"
. However beware that this does not register a dependency with Lake, so your Lean module will not automatically be rebuilt when the.js
file changes.
A widget module is a unit of source code that can execute in the infoview.
Instances For
- id : Lean.Name
Name of the
widget_module
to show. - props : ProofWidgets.LazyEncodable Lean.Json
- infoId : Lean.Name
Instances For
- id : Lean.Name
Name of the
widget_module
. - srcHash : UInt64
- props : ProofWidgets.LazyEncodable Lean.Json
- infoId : Lean.Name
A widget component with a resolved source hash and its props.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- id : Lean.Name
- srcHash : UInt64
- props : ProofWidgets.LazyEncodable Lean.Json
- infoId : Lean.Name
- range? : Option Lean.Lsp.Range
Instances For
Equations
- One or more equations did not get rendered due to their size.
- widgets : Array ProofWidgets.PanelWidgetInstance
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Save the data of a panel widget which will be displayed whenever the text cursor is on stx
.
id
must be the name of a definition annotated with @[widget_module]
. See PanelWidgetProps
.
Equations
- One or more equations did not get rendered due to their size.