Skip to content

Commit

Permalink
fix: save local instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Vtec234 committed Jul 24, 2024
1 parent eaba628 commit 6a40117
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ProofWidgets/Compat.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ abbrev LazyEncodable α := StateM RpcObjectStore α
structure ExprWithCtx where
ci : Elab.ContextInfo
lctx : LocalContext
linsts : LocalInstances
expr : Expr
deriving TypeName

def ExprWithCtx.runMetaM (e : ExprWithCtx) (x : Expr → MetaM α) : IO α :=
e.ci.runMetaM e.lctx (x e.expr)
e.ci.runMetaM {} $
Meta.withLCtx e.lctx e.linsts (x e.expr)

def ExprWithCtx.save (e : Expr) : MetaM ExprWithCtx :=
return {
ci := { ← CommandContextInfo.save with }
lctx := ← getLCtx
linsts := ← getLocalInstances
expr := e
}

Expand Down

0 comments on commit 6a40117

Please sign in to comment.