Skip to content

Commit

Permalink
fix: no non-expr embeds in diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vtec234 committed Aug 4, 2021
1 parent c394e5a commit 33ce512
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Lean/Widget/InteractiveDiagnostics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ private def msgToInteractive (msgData : MessageData) : IO (TaggedText MsgEmbed)
and store the pretty-printed embed (which is itself a `TaggedText (WithRpcRef LazyExprWithCtx)`,
for example) in the tag. -/
tt.rewriteM fun n subTt =>
match embeds.get! n with
| EmbedFmt.ofExpr e =>
match embeds.get? n with
| some (EmbedFmt.ofExpr e) =>
TaggedText.tag
{ ef := subTt.map fun n => ⟨fun () => e.runMetaM (e.traverse n)⟩ }
(TaggedText.text "")
| none => TaggedText.text subTt.stripTags

private partial def stripEmbeds (tt : TaggedText MsgEmbed) : String :=
let tt : TaggedText MsgEmbed := tt.rewrite fun ⟨et⟩ _ => TaggedText.text et.stripTags
Expand Down

0 comments on commit 33ce512

Please sign in to comment.