Equations
- One or more equations did not get rendered due to their size.
Instances For
- information: Lean.MessageSeverity
- warning: Lean.MessageSeverity
- error: Lean.MessageSeverity
Instances For
Equations
- Lean.instInhabitedMessageSeverity = { default := Lean.MessageSeverity.information }
Equations
- Lean.instBEqMessageSeverity = { beq := Lean.beqMessageSeverity✝ }
Equations
- Lean.instToJsonMessageSeverity = { toJson := Lean.toJsonMessageSeverity✝ }
Equations
- Lean.instFromJsonMessageSeverity = { fromJson? := Lean.fromJsonMessageSeverity✝ }
- env : Lean.Environment
- mctx : Lean.MetavarContext
- lctx : Lean.LocalContext
- opts : Lean.Options
Instances For
A naming context is the information needed to shorten names in pretty printing.
It gives the current namespace and the list of open declarations.
- currNamespace : Lean.Name
- openDecls : List Lean.OpenDecl
Instances For
- cls : Lean.Name
Trace class, e.g.
Elab.step
. - startTime : Float
Start time in seconds; 0 if unknown to avoid
Option
allocation. - stopTime : Float
Stop time in seconds; 0 if unknown to avoid
Option
allocation. - collapsed : Bool
Whether trace node defaults to collapsed in the infoview.
- tag : String
Optional tag shown in
trace.profiler.output
output after the trace class name.
Instances For
Structured message data. We use it for reporting errors, trace messages, etc.
- ofFormatWithInfos: Lean.FormatWithInfos → Lean.MessageData
Eagerly formatted text with info annotations. This constructor is inspected in various hacks.
- ofGoal: Lean.MVarId → Lean.MessageData
- ofWidget: Lean.Widget.WidgetInstance → Lean.MessageData → Lean.MessageData
A widget instance.
In
ofWidget wi alt
, the nested messagealt
should approximate the contents of the widget without itself usingofWidget wi _
. This is used as fallback in environments that cannot display user widgets.alt
may nest any structured message, for exampleofGoal
to approximate a tactic state widget, and, if necessary, even other widget instances (for which approximations are computed recursively). - withContext: Lean.MessageDataContext → Lean.MessageData → Lean.MessageData
withContext ctx d
specifies the pretty printing context(env, mctx, lctx, opts)
for the nested expressions ind
. - withNamingContext: Lean.NamingContext → Lean.MessageData → Lean.MessageData
- nest: Nat → Lean.MessageData → Lean.MessageData
Lifted
Format.nest
- group: Lean.MessageData → Lean.MessageData
Lifted
Format.group
- compose: Lean.MessageData → Lean.MessageData → Lean.MessageData
Lifted
Format.compose
- tagged: Lean.Name → Lean.MessageData → Lean.MessageData
Tagged sections.
Name
should be viewed as a "kind", and is used byMessageData
inspector functions. Example: an inspector that tries to find "definitional equality failures" may look for the tag "DefEqFailure". - trace: Lean.TraceData → Lean.MessageData → Array Lean.MessageData → Lean.MessageData
- ofLazy: (Option Lean.PPContext → IO Dynamic) → (Lean.MetavarContext → Bool) → Lean.MessageData
A lazy message. The provided thunk will not be run until it is about to be displayed. This can save computation in cases where the message may never be seen.
The
Dynamic
value is expected to be aMessageData
, which is a workaround for the positivity restriction.If the thunked message is produced for a term that contains a synthetic sorry,
hasSyntheticSorry
should returntrue
. This is used to filter out certain messages.
Instances For
Equations
- Lean.instInhabitedMessageData = { default := Lean.MessageData.ofGoal default }
Eagerly formatted text.
Equations
- Lean.MessageData.ofFormat fmt = Lean.MessageData.ofFormatWithInfos { fmt := fmt, infos := Lean.RBMap.empty }
Instances For
Lazy message data production, with access to the context as given by
a surrounding MessageData.withContext
(which is expected to exist).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns true when the message contains a MessageData.tagged tag ..
constructor where p tag
is true.
This does not descend into lazily generated subtress (.ofLazy
); message tags
of interest (like those added by logLinter
) are expected to be near the root
of the MessageData
, and not hidden inside .ofLazy
.
An empty message.
Instances For
Equations
- Lean.MessageData.mkPPContext nCtx ctx = { env := ctx.env, mctx := ctx.mctx, lctx := ctx.lctx, opts := ctx.opts, currNamespace := nCtx.currNamespace, openDecls := nCtx.openDecls }
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Represents a constant name such that hovering and "go to definition" works.
If there is no such constant in the environment, the name is simply formatted, but sanitized if it is a hygienic name.
Use MessageData.ofName
if hovers are undesired.
If fullNames
is true, then pretty prints as if pp.fullNames
is true.
Otherwise, pretty prints using the current user setting for pp.fullNames
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- msg.hasSyntheticSorry = Lean.MessageData.hasSyntheticSorry.visit none msg
Instances For
Equations
- msgData.format = Lean.MessageData.formatAux { currNamespace := Lean.Name.anonymous, openDecls := [] } none msgData
Instances For
Instances For
Equations
- Lean.MessageData.instAppend = { append := Lean.MessageData.compose }
Equations
- Lean.MessageData.instCoeString = { coe := Lean.MessageData.ofFormat ∘ Lean.format }
Equations
Equations
Equations
- Lean.MessageData.instCoeExpr = { coe := Lean.MessageData.ofExpr }
Equations
- Lean.MessageData.instCoeName = { coe := Lean.MessageData.ofName }
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.MessageData.instCoeArrayExpr = { coe := fun (es : Array Lean.Expr) => Lean.MessageData.arrayExpr.toMessageData es 0 ((Lean.MessageData.ofFormat ∘ Lean.format) "#[") }
Wrap the given message in l
and r
. See also Format.bracket
.
Equations
- Lean.MessageData.bracket l f r = (Lean.MessageData.nest l.length ((Lean.MessageData.ofFormat ∘ Lean.format) l ++ f ++ (Lean.MessageData.ofFormat ∘ Lean.format) r)).group
Instances For
Wrap the given message in parentheses ()
.
Equations
- f.paren = Lean.MessageData.bracket "(" f ")"
Instances For
Wrap the given message in square brackets []
.
Equations
- f.sbracket = Lean.MessageData.bracket "[" f "]"
Instances For
Append the given list of messages with the given separator.
Equations
- Lean.MessageData.joinSep [] x = Lean.MessageData.ofFormat Lean.Format.nil
- Lean.MessageData.joinSep [a] x = a
- Lean.MessageData.joinSep (a :: as) x = a ++ x ++ Lean.MessageData.joinSep as x
Instances For
Write the given list of messages as a list, separating each item with ,\n
and surrounding with square brackets.
Equations
- Lean.MessageData.ofList [] = (Lean.MessageData.ofFormat ∘ Lean.format) "[]"
- Lean.MessageData.ofList x = (Lean.MessageData.joinSep x (Lean.MessageData.ofFormat (Std.Format.text ",") ++ Lean.MessageData.ofFormat Lean.Format.line)).sbracket
Instances For
See MessageData.ofList
.
Equations
- Lean.MessageData.ofArray msgs = Lean.MessageData.ofList msgs.toList
Instances For
Puts MessageData
into a comma-separated list with "or"
at the back (no Oxford comma).
Best used on non-empty lists; returns "– none –"
for an empty list.
Equations
- One or more equations did not get rendered due to their size.
- Lean.MessageData.orList [] = (Lean.MessageData.ofFormat ∘ Lean.format) "– none –"
- Lean.MessageData.orList [x] = (Lean.MessageData.ofFormat ∘ Lean.format) "'" ++ x ++ (Lean.MessageData.ofFormat ∘ Lean.format) "'"
Instances For
Puts MessageData
into a comma-separated list with "and"
at the back (no Oxford comma).
Best used on non-empty lists; returns "– none –"
for an empty list.
Equations
- Lean.MessageData.andList [] = (Lean.MessageData.ofFormat ∘ Lean.format) "– none –"
- Lean.MessageData.andList [x] = x
- Lean.MessageData.andList xs = Lean.MessageData.joinSep xs.dropLast ((Lean.MessageData.ofFormat ∘ Lean.format) ", ") ++ (Lean.MessageData.ofFormat ∘ Lean.format) " and " ++ xs.getLast!
Instances For
Equations
- Lean.MessageData.instCoeList = { coe := Lean.MessageData.ofList }
Equations
- Lean.MessageData.instCoeListExpr = { coe := fun (es : List Lean.Expr) => Lean.MessageData.ofList (List.map Lean.MessageData.ofExpr es) }
A BaseMessage
is a richly formatted piece of information emitted by Lean.
They are rendered by client editors in the infoview and in diagnostic windows.
There are two varieties in the Lean core:
Message
: Uses structured, effectfulMessageData
for formatting content.SerialMessage
: Stores pureString
data. Obtained by running the effectfulMessage.serialize
.
- fileName : String
- pos : Lean.Position
- endPos : Option Lean.Position
- keepFullRange : Bool
If
true
, report range as given; seemsgToInteractiveDiagnostic
. - severity : Lean.MessageSeverity
- data : α
The content of the message.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.instToJsonBaseMessage = { toJson := Lean.toJsonBaseMessage✝ }
Equations
- Lean.instFromJsonBaseMessage = { fromJson? := Lean.fromJsonBaseMessage✝ }
A Message
is a richly formatted piece of information emitted by Lean.
They are rendered by client editors in the infoview and in diagnostic windows.
Equations
Instances For
A SerialMessage
is a Message
whose MessageData
has been eagerly
serialized and is thus appropriate for use in pure contexts where the effectful
MessageData.toString
cannot be used.
Equations
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
Equations
- Lean.SerialMessage.instToString = { toString := fun (msg : Lean.SerialMessage) => msg.toString }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- msg.toJson = do let __do_lift ← msg.serialize pure (inline (Lean.toJson __do_lift))
Instances For
A persistent array of messages.
In the Lean elaborator, we use a fresh message log per command but may also report diagnostics at
various points inside a command, which will empty unreported
and updated hadErrors
accordingly
(see CoreM.getAndEmptyMessageLog
).
- hadErrors : Bool
If true, there was an error in the log previously that has already been reported to the user and removed from the log. Thus we say that in the current context (usually the current command), we "have errors" if either this flag is set or there is an error in
msgs
; seeMessageLog.hasErrors
. If we have errors, we suppress some error messages that are often the result of a previous error. - unreported : Lean.PersistentArray Lean.Message
The list of messages not already reported, in insertion order.
- reportedKinds : Lean.NameSet
Set of message kinds that have been added to the log. For example, we have the kind
unsafe.exponentiation.warning
for warning messages associated with the configuration optionexponentiation.threshold
. We don't produce a warning if the kind is already in the following set.
Instances For
Equations
- Lean.instInhabitedMessageLog = { default := { hadErrors := default, unreported := default, reportedKinds := default } }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Equations
- Lean.MessageLog.add msg log = { hadErrors := log.hadErrors, unreported := log.unreported.push msg, reportedKinds := log.reportedKinds }
Instances For
Equations
Instances For
Equations
- Lean.MessageLog.instAppend = { append := Lean.MessageLog.append }
Equations
- log.hasErrors = (log.hadErrors || log.unreported.any fun (x : Lean.Message) => match x.severity with | Lean.MessageSeverity.error => true | x => false)
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
Equations
- log.forM f = log.unreported.forM f
Instances For
Converts the unreported messages to a list, oldest message first.
Equations
- log.toList = log.unreported.toList
Instances For
Converts the unreported messages to an array, oldest message first.
Equations
- log.toArray = log.unreported.toArray
Instances For
Equations
- msg.nestD = Lean.MessageData.nest 2 msg
Instances For
Equations
- Lean.indentD msg = (Lean.MessageData.ofFormat Lean.Format.line ++ msg).nestD
Instances For
Equations
Instances For
- addMessageContext : Lean.MessageData → m Lean.MessageData
Without context, a
MessageData
object may be missing information (e.g. hover info) for pretty printing, or may print an error. Hence,addMessageContext
should be called on all constructedMessageData
(e.g. viam!
) before taking it out of context (e.g. leavingMetaM
orCoreM
).
Instances
Equations
- Lean.instAddMessageContextOfMonadLift m n = { addMessageContext := fun (msg : Lean.MessageData) => liftM (Lean.addMessageContext msg) }
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
- Lean.stringToMessageData str = Lean.MessageData.joinSep (List.map (Lean.MessageData.ofFormat ∘ Lean.format) (str.split fun (x : Char) => x == '\n')) (Lean.MessageData.ofFormat Lean.Format.line)
Instances For
Equations
- Lean.instToMessageDataOfToFormat = { toMessageData := Lean.MessageData.ofFormat ∘ Lean.format }
Equations
- Lean.instToMessageDataExpr = { toMessageData := Lean.MessageData.ofExpr }
Equations
- Lean.instToMessageDataLevel = { toMessageData := Lean.MessageData.ofLevel }
Equations
- Lean.instToMessageDataName = { toMessageData := Lean.MessageData.ofName }
Equations
- Lean.instToMessageDataString = { toMessageData := Lean.stringToMessageData }
Equations
- Lean.instToMessageDataSyntax = { toMessageData := Lean.MessageData.ofSyntax }
Equations
- Lean.instToMessageDataTSyntax = { toMessageData := fun (x : Lean.TSyntax k) => Lean.MessageData.ofSyntax x.raw }
Equations
- Lean.instToMessageDataFormat = { toMessageData := Lean.MessageData.ofFormat }
Equations
- Lean.instToMessageDataMVarId = { toMessageData := Lean.MessageData.ofGoal }
Equations
- Lean.instToMessageDataMessageData = { toMessageData := id }
Equations
- Lean.instToMessageDataList = { toMessageData := fun (as : List α) => Lean.MessageData.ofList (List.map Lean.toMessageData as) }
Equations
- Lean.instToMessageDataArray = { toMessageData := fun (as : Array α) => Lean.toMessageData as.toList }
Equations
- Lean.instToMessageDataSubarray = { toMessageData := fun (as : Subarray α) => Lean.toMessageData as.toArray.toList }
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
- 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
- Lean.toMessageList msgs = Lean.indentD (Lean.MessageData.joinSep msgs.toList (Lean.toMessageData "\n\n"))
Instances For
Equations
- One or more equations did not get rendered due to their size.
- (Lean.KernelException.other msg).toMessageData opts = Lean.toMessageData "(kernel) " ++ Lean.toMessageData msg ++ Lean.toMessageData ""
- Lean.KernelException.deterministicTimeout.toMessageData opts = (Lean.MessageData.ofFormat ∘ Lean.format) "(kernel) deterministic timeout"
- Lean.KernelException.excessiveMemory.toMessageData opts = (Lean.MessageData.ofFormat ∘ Lean.format) "(kernel) excessive memory consumption detected"
- Lean.KernelException.deepRecursion.toMessageData opts = (Lean.MessageData.ofFormat ∘ Lean.format) "(kernel) deep recursion detected"
- Lean.KernelException.interrupted.toMessageData opts = (Lean.MessageData.ofFormat ∘ Lean.format) "(kernel) interrupted"