@@ -1320,13 +1320,13 @@ def isTacticOrPostponedHole? (e : Expr) : TermElabM (Option MVarId) := do
13201320 | _ => pure none
13211321
13221322def mkTermInfo (elaborator : Name) (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none)
1323- (lctx? : Option LocalContext := none) (isBinder := false ) :
1323+ (lctx? : Option LocalContext := none) (isBinder := false ) (isDisplayableTerm := false ) :
13241324 TermElabM (Sum Info MVarId) := do
13251325 match (← isTacticOrPostponedHole? e) with
13261326 | some mvarId => return Sum.inr mvarId
13271327 | none =>
13281328 let e := removeSaveInfoAnnotation e
1329- return Sum.inl <| Info.ofTermInfo { elaborator, lctx := lctx?.getD (← getLCtx), expr := e, stx, expectedType?, isBinder }
1329+ return Sum.inl <| Info.ofTermInfo { elaborator, lctx := lctx?.getD (← getLCtx), expr := e, stx, expectedType?, isBinder, isDisplayableTerm }
13301330
13311331def mkPartialTermInfo (elaborator : Name) (stx : Syntax) (expectedType? : Option Expr := none)
13321332 (lctx? : Option LocalContext := none) :
@@ -1350,18 +1350,21 @@ is a constant they will see the constant's doc string.
13501350 -/
13511351def addTermInfo (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none)
13521352 (lctx? : Option LocalContext := none) (elaborator := Name.anonymous)
1353- (isBinder := false ) (force := false ) : TermElabM Expr := do
1353+ (isBinder := false ) (force := false ) (isDisplayableTerm := false ) : TermElabM Expr := do
13541354 if (← read).inPattern && !force then
13551355 return mkPatternWithRef e stx
13561356 else
13571357 discard <| withInfoContext'
13581358 (pure ())
1359- (fun _ => mkTermInfo elaborator stx e expectedType? lctx? isBinder)
1359+ (fun _ => mkTermInfo elaborator stx e expectedType? lctx? isBinder isDisplayableTerm )
13601360 (mkPartialTermInfo elaborator stx expectedType? lctx?)
13611361 return e
13621362
1363- def addTermInfo' (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) (elaborator := Name.anonymous) (isBinder := false ) : TermElabM Unit :=
1363+ def addTermInfo' (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none)
1364+ (lctx? : Option LocalContext := none) (elaborator := Name.anonymous) (isBinder := false )
1365+ (isDisplayableTerm := false ) : TermElabM Unit :=
13641366 discard <| addTermInfo stx e expectedType? lctx? elaborator isBinder
1367+ (isDisplayableTerm := isDisplayableTerm)
13651368
13661369def withInfoContext' (stx : Syntax) (x : TermElabM Expr)
13671370 (mkInfo : Expr → TermElabM (Sum Info MVarId)) (mkInfoOnError : TermElabM Info) :
@@ -1389,10 +1392,11 @@ def getBodyInfo? : Info → Option BodyInfo
13891392
13901393def withTermInfoContext' (elaborator : Name) (stx : Syntax) (x : TermElabM Expr)
13911394 (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none)
1392- (isBinder : Bool := false ) :
1395+ (isBinder : Bool := false ) (isDisplayableTerm : Bool := false ) :
13931396 TermElabM Expr :=
13941397 withInfoContext' stx x
1395- (mkTermInfo elaborator stx (expectedType? := expectedType?) (lctx? := lctx?) (isBinder := isBinder))
1398+ (mkTermInfo elaborator stx (expectedType? := expectedType?) (lctx? := lctx?)
1399+ (isBinder := isBinder) (isDisplayableTerm := isDisplayableTerm))
13961400 (mkPartialTermInfo elaborator stx (expectedType? := expectedType?) (lctx? := lctx?))
13971401
13981402/--
0 commit comments