Docs #
Small helpers for surfacing docstrings in the InfoView.
This is intentionally available through the widget entrypoint (import NN.Entrypoint.Widgets) or
directly as import NN.Widgets.Core.Docs, since it depends on ProofWidgets.
Commands:
#tl_doc fprints the type + docstring forfas an info message.#tl_doc_view frenders the type + docstring forfas a rich HTML panel in the InfoView.
Tip: if you already have an identifier in the InfoView (e.g. under “Expected type”), you can also
hover it to see its type + docstring. InfoView hover tooltips can be toggled in VS Code under
Lean 4 > Infoview: Show Tooltip On Hover.
Main definitions #
#tl_doc f: printf's type and docstring in a plain info message.#tl_doc_view f: show the same information in a richer HTML panel.
Implementation notes #
- We intentionally keep the command surface small: in day-to-day work, one "quick text" and one "richer panel" mode is usually enough.
- We resolve terms to constants before lookup, because that keeps behavior predictable and avoids surprising partial reductions.
- We use ProofWidgets
#htmlso this stays a Lean-native widget (no external JS pipeline).
References #
Tags #
docs, infoview, proofwidgets, metaprogramming, developer-tools
Instances For
Return the head constant name of an application, if one exists.
Instances For
Normalize optional docs into user-facing text.
Instances For
Pretty-print a declaration type using Lean's normal pretty-printer.
Instances For
Resolve an input term to a declaration name for doc lookup.