Storage of widget modules #
Equations
- Lean.Widget.instToModuleModule = { toModule := id }
Equations
- Lean.Widget.addBuiltinModule id m = ST.Ref.modify Lean.Widget.builtinModulesRef✝ fun (x : Std.TreeMap UInt64 (Lean.Name × Lean.Widget.Module) compare) => x.insert m.javascriptHash.val (id, m)
Instances For
Registers a widget module. Its type must implement Lean.Widget.ToModule.
Retrieval of widget modules #
- hash : UInt64
Hash of the JS module to retrieve.
- pos : Lsp.Position
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- sourcetext : String
Sourcetext of the JS module to run.
Instances For
Equations
- Lean.Widget.instInhabitedWidgetSource.default = { sourcetext := default }
Instances For
Equations
- Lean.Widget.instToJsonWidgetSource.toJson x✝ = Lean.Json.mkObj [[("sourcetext", Lean.toJson x✝.sourcetext)]].flatten
Instances For
Equations
Equations
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
Storage of panel widget instances #
- global (n : Name) : PanelWidgetsExtEntry
- local (wi : WidgetInstance) : PanelWidgetsExtEntry
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct a widget instance by finding a widget module in the current environment.
hash must be hash (toModule c).javascript
where c is some global constant annotated with @[widget_module],
or the name of a builtin widget module.
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.
hash must be as in WidgetInstance.ofHash.
For panel widgets, the Lean infoview appends additional fields to the props object:
see https://github.com/leanprover/vscode-lean4/blob/master/lean4-infoview/src/infoview/userWidget.tsx#L145.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Deprecated definitions #
Use this structure and the @[widget] attribute to define your own widgets.
@[widget]
def rubiks : UserWidgetDefinition :=
{ name := "Rubiks cube app"
javascript := include_str ...
}
- name : String
Pretty name of user widget to display to the user.
- javascript : String
An ESmodule that exports a react component to render.
Instances For
Equations
Instances For
Equations
- Lean.Widget.instToJsonUserWidgetDefinition.toJson x✝ = Lean.Json.mkObj [[("name", Lean.toJson x✝.name)], [("javascript", Lean.toJson x✝.javascript)]].flatten
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Widget.instToModuleUserWidgetDefinition = { toModule := fun (uwd : Lean.Widget.UserWidgetDefinition) => { javascript := uwd.javascript } }
Retrieving panel widget instances #
Retrieve all the UserWidgetInfos that intersect a given line.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The syntactic span in the Lean file at which the panel widget is displayed.
When present, the infoview will wrap the widget in
<details><summary>{name}</summary>...</details>. This functionality is deprecated but retained for backwards compatibility withUserWidgetDefinition.
Instances For
Get the panel widgets present around a particular position.
Equations
- One or more equations did not get rendered due to their size.