The internal state used by docstring elaboration
- footnotes : Std.HashMap String (Lean.Doc.Ref✝ (Lean.Doc.Inline Lean.ElabInline))
- urls : Std.HashMap String (Lean.Doc.Ref✝ String)
Instances For
The state used by DocM.
- scopes : List Elab.Command.Scope
The command elaboration scope stack.
These scopes are used when running commands inside of documentation. To keep examples self-contained, these scopes are initialized for each doc comment as if it were the beginning of a Lean file.
- lctx : LocalContext
- options : Options
Instances For
Determines whether docstring suggestions are to be provided as part of editing the string or in a later report.
- interactive : SuggestionMode
The user is currently editing the doc comment and can react to suggestions as code actions.
- batch : SuggestionMode
The user is not editing the doc comment, and should receive suggestions as summaries.
Instances For
Equations
Equations
- Lean.Doc.instBEqSuggestionMode.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Context used as a reader in DocM.
- suggestionMode : SuggestionMode
Whether suggestions should be provided interactively.
Instances For
The monad in which documentation is elaborated.
Equations
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.
Equations
- Lean.Doc.instMonadLiftTermElabMDocM = { monadLift := fun {α : Type} (act : Lean.Elab.TermElabM α) => Lean.Doc.instMonadLiftTermElabMDocM._private_1 act }
Runs a documentation elaborator in the module docstring context.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Runs a documentation elaborator in a declaration's context, discarding changes made to the environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gadget that indicates that a function's parameter should be treated as a Boolean flag when used in a docstring extension.
Equations
- Lean.Doc.flag default = Bool
Instances For
Gadget that indicates that a function's parameter should be treated as a repeated (and thus optional) named argument when used in a docstring extension.
Equations
- Lean.Doc.many α = Array α
Instances For
Equations
- One or more equations did not get rendered due to their size.
Returns the syntax from which a documentation argument was drawn, typically used to report errors.
Equations
- (Lean.Doc.DocArg.ident x_1).syntax = x_1.raw
- (Lean.Doc.DocArg.num n).syntax = n.raw
- (Lean.Doc.DocArg.str s).syntax = s.raw
Instances For
Converts the syntax of a documentation argument into a suitable value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A value paired with the syntax it is derived from.
This can be used to provide hints and code actions.
- val : α
The parsed value.
- stx : Syntax
The syntax that the value was derived from.
Instances For
A canonical way to convert a documentation extension's argument into a Lean value of type α.
- fromDocArg : DocArg → Elab.TermElabM α
Converts a documentation extension's argument into a Lean value.
Instances
Equations
- Lean.Doc.instFromDocArgOption = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgOption._private_1 v }
Equations
- Lean.Doc.instFromDocArgWithSyntax = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgWithSyntax._private_1 v }
Equations
- Lean.Doc.instFromDocArgIdent = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgIdent._private_1 v }
Equations
- Lean.Doc.instFromDocArgString = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgString._private_1 v }
Equations
- Lean.Doc.instFromDocArgStrLit = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgStrLit._private_1 v }
Equations
- Lean.Doc.instFromDocArgNat = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgNat._private_1 v }
Equations
- Lean.Doc.instFromDocArgNumLit = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgNumLit._private_1 v }
Equations
- Lean.Doc.instFromDocArgDataValue = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgDataValue._private_1 v }
Equations
- Lean.Doc.instFromDocArgBool = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgBool._private_1 v }
Equations
- Lean.Doc.instFromDocArgMessageSeverity = { fromDocArg := fun (v : Lean.Doc.DocArg) => Lean.Doc.instFromDocArgMessageSeverity._private_1 v }
Retrieves the next positional argument from the arguments to a documentation extension. Throws an error if no positional arguments remain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Retrieves a named argument from the arguments to a documentation extension. Returns default if no
such named argument was provided.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Retrieves a repeated named argument from the arguments to a documentation extension.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Environment extension for code suggestions
Environment extension for code block suggestions
Environment extension for docstring roles
An expander for roles in docstrings.
Equations
- Lean.Doc.DocRoleExpander = (Lean.TSyntaxArray `inline → StateT (Array (Lean.TSyntax `doc_arg)) Lean.Doc.DocM (Lean.Doc.Inline Lean.ElabInline))
Instances For
An expander for commands in docstrings.
Equations
Instances For
An expander for directives in docstrings.
Equations
- Lean.Doc.DocDirectiveExpander = (Lean.TSyntaxArray `block → StateT (Array (Lean.TSyntax `doc_arg)) Lean.Doc.DocM (Lean.Doc.Block Lean.ElabInline Lean.ElabBlock))
Instances For
An expander for code blocks in docstrings.
Equations
Instances For
Built-in docstring roles, for bootstrapping.
Environment extension for docstring roles
Built-in docstring code blocks, for bootstrapping.
Environment extension for docstring directives
Built-in docstring directives, for bootstrapping.
Environment extension for docstring commands
Built-in docstring commands, for bootstrapping.
A provider of suggestions for code elements.
Equations
Instances For
Built-in code suggestions, for bootstrapping
Adds a builtin documentation code suggestion provider.
Should be run during initialization.
Equations
- Lean.Doc.addBuiltinCodeSuggestion decl val = ST.Ref.modify Lean.Doc.builtinCodeSuggestions fun (x : Array (Lean.Name × Lean.Doc.CodeSuggester)) => x.push (decl, val)
Instances For
Adds a builtin documentation role.
Should be run during initialization.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a builtin documentation code block.
Should be run during initialization.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A provider of suggestions for code elements.
Equations
Instances For
Built-in code block suggestions, for bootstrapping
Adds a builtin documentation code suggestion provider.
Should be run during initialization.
Equations
- Lean.Doc.addBuiltinCodeBlockSuggestion decl val = ST.Ref.modify Lean.Doc.builtinCodeBlockSuggestions fun (x : Array (Lean.Name × Lean.Doc.CodeBlockSuggester)) => x.push (decl, val)
Instances For
Adds a builtin documentation directive.
Should be run during initialization.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a builtin documentation command.
Should be run during initialization.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborates the syntax of an inline document element to an actual inline document element.
Elaborates the syntax of an block-level document element to an actual block-level document element.
Elaborates a sequence of blocks into a document.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborates a sequence of blocks into a module doc snippet.
Equations
- Lean.Doc.elabModSnippet range blocks nestingLevel = do let s ← Lean.Doc.elabModSnippet'✝ range nestingLevel blocks let s ← Lean.Doc.fixupSnippet✝ s Lean.Doc.warnUnusedRefs✝ pure s