- pos : Lean.Position
- charUtf16 : Nat
- endPos : Lean.Position
- endCharUtf16 : Nat
Equations
- Lean.instReprDeclarationRange = { reprPrec := [anonymous] }
Equations
- Lean.instInhabitedDeclarationRange = { default := { pos := default, charUtf16 := default, endPos := default, endCharUtf16 := default } }
Equations
- Lean.instToExprDeclarationRange = { toExpr := fun r => Lean.mkAppN (Lean.mkConst `Lean.DeclarationRange.mk) #[Lean.toExpr r.pos, Lean.toExpr r.charUtf16, Lean.toExpr r.endPos, Lean.toExpr r.endCharUtf16], toTypeExpr := Lean.mkConst `Lean.DeclarationRange }
- range : Lean.DeclarationRange
- selectionRange : Lean.DeclarationRange
Equations
- Lean.instInhabitedDeclarationRanges = { default := { range := default, selectionRange := default } }
Equations
- Lean.instReprDeclarationRanges = { reprPrec := [anonymous] }
Equations
- Lean.instToExprDeclarationRanges = { toExpr := fun r => Lean.mkAppN (Lean.mkConst `Lean.DeclarationRanges.mk) #[Lean.toExpr r.range, Lean.toExpr r.selectionRange], toTypeExpr := Lean.mkConst `Lean.DeclarationRanges }
Equations
- Lean.addBuiltinDeclarationRanges declName declRanges = ST.Ref.modify Lean.builtinDeclRanges fun a => Lean.NameMap.insert a declName declRanges
def
Lean.addDeclarationRanges
{m : Type → Type}
[inst : Lean.MonadEnv m]
(declName : Lean.Name)
(declRanges : Lean.DeclarationRanges)
:
m Unit
Equations
- Lean.addDeclarationRanges declName declRanges = Lean.modifyEnv fun env => Lean.MapDeclarationExtension.insert Lean.declRangeExt env declName declRanges
def
Lean.findDeclarationRangesCore?
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
(declName : Lean.Name)
:
Equations
- Lean.findDeclarationRangesCore? declName = do let a ← Lean.getEnv pure (Lean.MapDeclarationExtension.find? Lean.declRangeExt a declName)
def
Lean.findDeclarationRanges?
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
[inst : MonadLiftT IO m]
(declName : Lean.Name)
:
Equations
- Lean.findDeclarationRanges? declName = do let a ← liftM (ST.Ref.get Lean.builtinDeclRanges) let _do_jp : PUnit → m (Option Lean.DeclarationRanges) := fun y => do let env ← Lean.getEnv let a ← Lean.isRec declName if (Lean.isAuxRecursor env declName || Lean.isNoConfusion env declName || a) = true then Lean.findDeclarationRangesCore? (Lean.Name.getPrefix declName) else Lean.findDeclarationRangesCore? declName match Lean.NameMap.find? a declName with | some ranges => pure (some ranges) | x => do let y ← pure PUnit.unit _do_jp y